dart-compilation-deployment
Installation
SKILL.md
Compiling Dart Applications
Contents
- Compilation Targets & Conditional Logic
- Workflow: Compiling Native Executables
- Workflow: Compiling AOT Snapshots
- Workflow: Compiling for the Web
- Examples
Compilation Targets & Conditional Logic
Select the appropriate dart compile subcommand based on the deployment target and constraints:
- If deploying self-contained native binaries on Windows/macOS/Linux: Use
exe. This bundles the machine code and a minimal Dart runtime. - If deploying to resource-constrained environments or distributing multiple command-line apps: Use
aot-snapshot. This produces an architecture-specific module without the runtime. Execute it usingdartaotruntime. - If deploying to web targets: Use
jsorwasm. (See related skill:dart-web-development). - If optimizing for fast startup using training data: Use
jit-snapshot. - If requiring a portable module across all OS/CPU architectures: Use
kernel. Note that startup time is slower than AOT formats.
Note: The exe and aot-snapshot commands do not support dart:mirrors or dart:developer. They also do not run build hooks; use dart build if hooks are present.