Documentation menu

Build for production

On this page
Guides0.1.0-alpha.36

Build a native executable with production optimizations, then launch the reported path directly. The runtime is included; the target machine does not need Node.js or your source tree.

Check the build host

shell
maligator doctor --verbose
maligator build --production

Production builds compile C locally. Matching archives from the platform package let the build skip Rust compilation. When the default C toolchain cannot build the runtime, Maligator tries an existing Zig installation or downloads a pinned release. See Set up native builds.

Development builds keep native symbols and skip link-time optimization for useful crash diagnostics. --production adds link-time optimization when the toolchain supports it and strips native symbols after linking. When either step is unavailable, the build prints a warning and still produces a valid executable. Stripping keeps Maligator's JavaScript source positions.

The output name comes from outputName, the unscoped package name, or the project directory. Production binaries are placed under the project build cache; use the path the command prints rather than guessing its cache identity.

Create a deployable artifact

shell
maligator build --production --artifact dist/my-app

The destination must be absent or empty. The result contains:

text
my-app/
  artifact.json
  LICENSE
  SHA256SUMS
  THIRD_PARTY_NOTICES.md
  bin/
    <application>

artifact.json records version, target, production status, size, and SHA-256 identity. Copy or archive the complete directory. If profiling was requested, profile.jsonl is also included.

Configuration environment reads happen at build time. Runtime arguments and environment values belong to the launched application; they do not change the captured execution context.

Build for another target

shell
maligator doctor --target x86_64-unknown-linux-gnu --verbose
maligator build --production --target x86_64-unknown-linux-gnu

Cross-builds use Zig. Follow the cross-build setup for the target's runtime archives or Rust standard library, then test the artifact on its intended host.

Bound worker-image compilation

Production builds overlap the owning compiler with up to two worker-image compilers, bounded by the host CPU budget. --compile-concurrency 1 selects serial compilation; values 2 or 3 lower the total job limit. Applications without worker roots and cache hits start no helpers. This flag requires --production; profiling stays serial.

Retain source, config, Maligator version, and toolchain identity with your release. Output caching avoids repeated work but does not establish byte-for-byte reproducibility across toolchains. Use profiling for performance evidence and CLI build options for exact flags.

Maligator 0.1.0-alpha.36 · Experimental · Source 6af07bd09681
Edit this page · Compatibility

Search guides and API reference.

Browse the API · Troubleshooting