Building your app
To build your application without starting the development server, run:
au buildYou can also specify an environment:
au build --env stageThis command creates optimized bundles of your app, ready for deployment.
Build Environments
The --env flag determines which environment configuration is used and what optimizations are applied:
au build # Development build (default)
au build --env dev # Explicit development build
au build --env stage # Staging build with minification
au build --env prod # Production build with full optimizationIn stage and prod environments, the build process automatically minifies your code and generates source maps (based on your aurelia.json configuration).
Build Output
By default, built files are placed in the scripts/ directory (or the output path configured in aurelia.json). The output typically includes:
app-bundle.js— Your application codevendor-bundle.js— Third-party dependencies
Watch Mode
To rebuild automatically when files change without starting a server:
This is useful when you're serving your app through an external server but still want the CLI to handle bundling.
Troubleshooting
If builds fail, common causes include:
Missing dependencies — Run
npm installto ensure all packages are installedTypeScript errors — Check for type errors in your source files
Bundle configuration — Verify that third-party dependencies are correctly listed in
aurelia.json
See Recipes & known issues for solutions to common build problems.
Last updated
Was this helpful?