Compilation Targets

JIT (Dart VM) Fast iteration, hot reload (Flutter debug), incremental compilation Native executable (AOT) dart compile exe bin/main.dart -o app

Self-contained, fast startup, no SDK needed on the target dart compile aot-snapshot + dartaotruntime Smaller artifacts sharing a runtime JIT snapshot / kernel dart compile jit-snapshot / kernel

Faster startup for JIT apps, portable kernel (.dill) dart compile js -O2 -o main.js web/main.dart dart2js (production). DDC for development.

dart compile wasm web/main.dart dart2wasm using WasmGC (Chrome 119+, Firefox 120+, Safari 18.2+). Flutter web --wasm.

dart compile exe --target-os linux --target-arch arm64 Compile Linux executables from other hosts (Dart 3.8+, check support)

flutter build apk/ipa/web/macos/windows/linux AOT for release builds

JIT vs AOT: JIT enables hot reload and dynamic features (dart:mirrors). AOT gives predictable performance and small, fast-starting binaries, but no runtime code loading or mirrors.

--define=FOO=bar with const String.fromEnvironment('FOO') gives compile-time configuration. bool.fromEnvironment('dart.vm.product') detects release builds.