Skip to content

compile

Compile your app's state machine to Wasm

The compile command is used to compile your Micro-Rollup's State Machine to portable WebAssembly (Wasm) binary.

Before compiling, it also performs lint checks using the @stackr/eslint-plugin, an ESLint plugin with few rules to prevent devs from adding non-deterministic code in transition functions.

Usage

» stackr compile --help
USAGE
  $ stackr compile [--skipLintChecks]
 
FLAGS
  --skipLintChecks  Whether to skip lint checks before compiling (default: false)
 
EXAMPLES
  $ stackr compile
  $ stackr compile --skipLintChecks

Example

Make sure you are in the project directory and run the following command:

$ npx @stackr/cli@latest compile

If all goes well, you will see the following output:

 🏗️  State Machine built

The produced build artifacts and the Wasm binary are placed inside the stackr_build directory.

$ ls stackr_build
build_logs.txt stf.js         stf.ts         stf.wasm

You may refer to the Checking your Wasm Binary section on how to check whether the binary was correctly compiled.