Dump IR at one or more pipeline stages. Comma-separated: hir (post-transform HIR), llvm (per-module .ll into .perry-trace/llvm/), or all
--focus <NAME>
Restrict --trace hir to functions/methods/classes whose name contains NAME, suppressing import/export/init noise. Implies --trace hir if no stage is given
--no-link
Produce .o object file only, skip linking
--no-codegen
Skip the package.jsonperry.codegen build-time steps (also PERRY_SKIP_CODEGEN=1). See Project Configuration
--keep-intermediates
Keep .o and .asm intermediate files
The --trace/--focus pair localizes “compiled to the wrong thing” bugs:
perry compile foo.ts --trace hir,llvm --focus parseRow dumps just the
parseRow function’s lowered HIR and the module’s LLVM IR, so you can see
which stage corrupted it without scrolling a full-module dump. --trace llvm
forces a full recompile (the object cache otherwise skips codegen for
unchanged modules, leaving the trace dir empty).
Enable V8 JavaScript runtime for unsupported npm packages
--enable-wasm-runtime
Force-link the wasmi WebAssembly host runtime (auto-detected when WebAssembly.* is referenced; needed only when loading via dlopen / FFI without a static reference)
# Simple CLI program
perry main.ts -o app
# iOS app for simulator
perry app.ts -o app --target ios-simulator
# visionOS app for simulator
perry app.ts -o app --target visionos-simulator
# Web app (WASM with DOM bridge — alias: --target wasm)
perry app.ts -o app --target web
# Plugin shared library
perry plugin.ts --output-type dylib -o plugin.dylib
# iOS widget with bundle ID
perry widget.ts --target ios-widget --app-bundle-id com.example.app
# Debug compilation
perry app.ts --print-hir 2>&1 | less
# Verbose compilation
perry compile app.ts -o app -vvv
# Type-checked compilation
perry app.ts -o app --type-check
# Raw WASM binary (no HTML wrapper)
perry app.ts -o app.wasm --target wasm
# Minified web output (compresses embedded JS bridge)
perry app.ts -o app --target web --minify