For the complete documentation index, see llms.txt. This page is also available as Markdown.

Updating & migrating

Updating

To keep the Aurelia CLI up-to-date:

npm update -g aurelia-cli

Regular updates ensure access to the latest features and bug fixes.

Migrating

From CLI Bundler to Webpack

To migrate your project from the CLI's built-in bundler to Webpack:

  1. Install Webpack Dependencies:

    npm install --save-dev webpack webpack-cli aurelia-webpack-plugin
  2. Generate Webpack Configuration:

    au migrate-to-webpack
  3. Update Project Files:

    • Replace aurelia_project/tasks with Webpack configurations.

    • Adjust package.json scripts accordingly.

Backup your project before migration.

Upgrade to Auto-tracing Bundler

The auto-tracing bundler (available in CLI version 1.0.0-beta.1+) automatically manages JavaScript dependencies, significantly reducing manual configuration requirements.

Prerequisites

Migration Steps

1. Update CLI Version:

2. Simplify aurelia.json Dependencies:

Most existing applications will work without modifications. However, you can remove many explicit dependency configurations:

Before (Manual Dependencies):

After (Auto-tracing):

3. Enable Build Caching:

Add cache configuration to improve build performance:

4. Add New Task Files:

The auto-tracing bundler includes cache management tasks. You may need to copy new task files from a fresh CLI project:

5. Optional: Install Gulp Cache Plugin

For enhanced transpilation caching:

What Auto-tracing Handles

Automatic Module Format Detection:

  • CommonJS modules

  • AMD modules

  • UMD modules

  • Native ES modules

Core Node.js Module Stubbing:

  • Uses same stubs as Webpack and Browserify

  • Ensures browser compatibility

Aurelia View Template Dependencies:

  • Automatically traces <require> statements

  • Includes referenced modules in bundles

NPM Package Resolution:

  • Handles main field resolution

  • Processes package.json configurations

  • Manages peer dependencies

Migration Benefits

1. Simplified Configuration:

  • Fewer manual dependency entries

  • Reduced aurelia.json maintenance

  • Automatic NPM package handling

2. Performance Improvements:

  • Build caching reduces compilation time

  • More efficient dependency resolution

  • Better incremental builds

3. Plugin Compatibility:

  • Standard NPM installation for all plugins

  • No CLI-specific installation procedures

  • Consistent behavior across bundlers

Verification Steps

After migration, verify everything works correctly:

Troubleshooting Auto-tracing Migration

Build Errors After Migration:

  1. Clear all caches:

  2. Check for incompatible dependencies:

    • Remove legacy dependency configurations

    • Ensure NPM packages are compatible versions

  3. Verify aurelia.json syntax:

    • JSON must be valid

    • Check for trailing commas or syntax errors

Missing Modules:

If the auto-tracer doesn't detect certain modules:

Update 3rd Party Plugin Installation Guide

When updating or installing 3rd party plugins:

  1. Install via NPM:

  2. Configure in aurelia.json:

    • Add necessary entries in the dependencies array.

    • Update copyFiles if additional assets are required.

Last updated

Was this helpful?