{"id":16756,"library":"aurelia-bundler","title":"Aurelia Bundler (SystemJS)","description":"aurelia-bundler is a utility library specifically designed for bundling JavaScript, HTML, and CSS assets within applications built using the Aurelia 1 framework, leveraging SystemJS as the module loader. It provides programmatic APIs, commonly integrated into build automation tools like Gulp, to consolidate application modules and their dependencies into optimized bundles for production deployment. The package is considered abandoned, with its last release, version 0.7.0, dating back approximately eight years. It has been superseded by the built-in bundler provided by the Aurelia CLI for Aurelia 1 projects, and is not compatible with Aurelia 2, which has transitioned to modern bundlers such as Vite, Webpack, or Parcel. The package primarily addresses the bundling needs of legacy Aurelia 1 applications that explicitly relied on the SystemJS module ecosystem. Its release cadence was irregular towards the end of its active lifecycle, focusing on minor updates and bug fixes.","status":"abandoned","version":"0.7.0","language":"javascript","source_language":"en","source_url":"http://github.com/aurelia/bundler","tags":["javascript","aurelia","systemjs","bundling","HTML","JavaScript","CSS"],"install":[{"cmd":"npm install aurelia-bundler","lang":"bash","label":"npm"},{"cmd":"yarn add aurelia-bundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add aurelia-bundler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for performing SystemJS-based bundling operations.","package":"systemjs-builder","optional":false},{"reason":"Commonly used as the task runner to integrate aurelia-bundler into build processes, though not a direct runtime dependency of the package itself.","package":"gulp","optional":true}],"imports":[{"note":"The 'bundle' function is the primary programmatic API. While CommonJS 'require' was prevalent in older build scripts, modern Node.js environments may prefer ESM 'import'.","wrong":"const bundle = require('aurelia-bundler').bundle;","symbol":"bundle","correct":"import { bundle } from 'aurelia-bundler';"}],"quickstart":{"code":"import gulp from 'gulp';\nimport { bundle } from 'aurelia-bundler';\n\nconst config = {\n  force: true,\n  baseURL: '.', // Relative path to your project root\n  configPath: './config.js', // Path to your SystemJS config file\n  bundles: {\n    \"dist/app-build\": {\n      includes: [\n        '[*.js]', // Include all JS files\n        '*.html!text', // Include all HTML templates as text\n        '*.css!text', // Include all CSS files as text\n        // Add other Aurelia modules or your app-specific modules here\n      ],\n      options: {\n        inject: true,\n        minify: true\n      }\n    },\n    \"dist/vendor-build\": {\n      includes: [\n        'aurelia-bootstrapper',\n        'aurelia-fetch-client',\n        'aurelia-router',\n        'aurelia-animator-css',\n        // Add other vendor dependencies here\n      ],\n      options: {\n        inject: true,\n        minify: true\n      }\n    }\n  }\n};\n\ngulp.task('bundle', function() {\n  console.log('Starting Aurelia bundling...');\n  return bundle(config)\n    .then(() => console.log('Aurelia bundling complete!'))\n    .catch(err => console.error('Aurelia bundling error:', err));\n});\n\n// To run this: ensure gulp and aurelia-bundler are installed as dev dependencies.\n// Then run 'gulp bundle' from your terminal.","lang":"javascript","description":"Demonstrates programmatic use of aurelia-bundler within a Gulp task to create application and vendor bundles for an Aurelia 1 SystemJS project."},"warnings":[{"fix":"For Aurelia 1 projects, migrate to the Aurelia CLI's built-in bundler. For new or migrating projects to Aurelia 2, use modern bundlers like Vite, Webpack, or Parcel with their respective Aurelia plugins.","message":"The `aurelia-bundler` project has been officially archived on GitHub since March 2020 and is no longer actively maintained. It was superseded by the built-in bundler in the Aurelia CLI.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Do not attempt to use `aurelia-bundler` with Aurelia 2. Aurelia 2 recommends Vite, Webpack, or Parcel.","message":"This bundler is designed exclusively for Aurelia 1 applications using SystemJS. It is incompatible with Aurelia 2, which has a different module resolution and bundling strategy.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"When migrating an Aurelia 1 project from `aurelia-bundler` to another solution, pay close attention to module resolution and ensure that 'PLATFORM.moduleName()' (if used for Webpack) is either correctly translated or removed for Aurelia 2, which no longer requires it.","message":"Aurelia 1 projects often used `PLATFORM.moduleName()` for Webpack compatibility to hint at dynamic module loading. `aurelia-bundler` typically didn't require this for SystemJS, but migration away from it often means understanding new bundler configurations for module resolution.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Ensure `tslib` is correctly configured and bundled. Verify that all dependencies are properly resolved and available at runtime. Review how the new bundler handles CommonJS/ESM interop and dependency injection for Aurelia 1 components.","cause":"Occurs during migration from `aurelia-bundler` to alternative bundlers for Aurelia 1, often due to issues with dependency injection, `tslib` configuration, or incorrect handling of module imports and exports by the new bundler.","error":"Uncaught (in promise) TypeError: Class extends value undefined is not a constructor or null"},{"fix":"Explicitly configure the bundler to include HTML files using patterns like `'*.html!text'`. For dynamically generated views, ensure the bundling configuration is aware of their paths or modify the application to fetch them at runtime rather than relying on bundling.","cause":"The bundler failed to automatically trace and include associated HTML view templates, especially in projects with non-standard file structures or dynamically generated views.","error":"Views not included in the bundles / Error: No View for [ViewModel]"}],"ecosystem":"npm","meta_description":null}