{"id":18970,"library":"aurelia-loader-webpack","title":"Aurelia Loader Webpack","description":"Aurelia's loader implementation for webpack, enabling module loading and Hot Module Replacement (HMR) in Aurelia applications built with webpack. This package implements the Aurelia loader interface, allowing dynamic loading of modules, views, and resources. It supports Aurelia 2 (v2.x line, latest stable 2.2.5) with a universal bootstrapper and HMR capabilities, and is designed for use with webpack 4+. The library is actively maintained by the Aurelia team and provides compatibility with css-loader v4. It is part of the Aurelia ecosystem and should be used alongside aurelia-webpack-plugin. Key differentiators: native HMR support, eachModule iteration module, and caching of loading promises. Alternatives: aurelia-loader-nodejs for server-side rendering.","status":"active","version":"2.2.5","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/aurelia/loader-webpack","tags":["javascript","aurelia","webpack","loader","typescript"],"install":[{"cmd":"npm install aurelia-loader-webpack","lang":"bash","label":"npm"},{"cmd":"yarn add aurelia-loader-webpack","lang":"bash","label":"yarn"},{"cmd":"pnpm add aurelia-loader-webpack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides the core loader interface that this implementation extends.","package":"aurelia-loader","optional":false},{"reason":"Required as a peer dependency; this loader integrates with webpack's module system.","package":"webpack","optional":false}],"imports":[{"note":"Requires a named import; default import is not supported.","wrong":"import AureliaLoaderWebpack from 'aurelia-loader-webpack';","symbol":"AureliaLoaderWebpack","correct":"import { AureliaLoaderWebpack } from 'aurelia-loader-webpack';"},{"note":"The base Loader class is in 'aurelia-loader', not in this package. webpack-loader implements it.","wrong":"import { Loader } from 'aurelia-loader-webpack';","symbol":"Loader","correct":"import { Loader } from 'aurelia-loader';"},{"note":"WebpackLoader is an alias for AureliaLoaderWebpack, exported for convenience.","wrong":"import { WebpackLoader } from 'aurelia-loader';","symbol":"WebpackLoader","correct":"import { WebpackLoader } from 'aurelia-loader-webpack';"}],"quickstart":{"code":"import { Aurelia } from 'aurelia-framework';\nimport { AureliaLoaderWebpack } from 'aurelia-loader-webpack';\nimport { PLATFORM } from 'aurelia-pal';\n\n// In your Aurelia configuration file:\nexport function configure(aurelia: Aurelia): void {\n  aurelia.use\n    .standardConfiguration()\n    .developmentLogging();\n    \n  // Register the webpack loader\n  aurelia.container.registerSingleton(Loader, AureliaLoaderWebpack);\n  \n  aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));\n}","lang":"typescript","description":"Shows how to register the AureliaLoaderWebpack in an Aurelia application and use PLATFORM.moduleName for module resolution."},"warnings":[{"fix":"Update your bootstrapping code to use the new loader API. Refer to the Aurelia 2 migration guide.","message":"Version 2.0.0 is a complete rewrite with a new universal bootstrapper and HMR support. It is not backward compatible with 1.x.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Upgrade to aurelia-loader-webpack@2.2.2 or later.","message":"When using css-loader v4, you may encounter compatibility issues. The fix was released in version 2.2.2.","severity":"gotcha","affected_versions":">=2.2.0 <2.2.2"},{"fix":"Do not return true from the eachModule callback unless you intend to stop iteration.","message":"The eachModule iteration shortcircuits when the callback returns true. This may cause unexpected behavior if you don't expect return values to stop iteration.","severity":"gotcha","affected_versions":">=2.2.1"},{"fix":"Use 'AureliaLoaderWebpack' instead of 'WebpackLoader' in imports.","message":"The export 'WebpackLoader' may be deprecated in future versions; prefer 'AureliaLoaderWebpack'.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Migrate to version 2.x and update your bootstrapper.","message":"Version 1.x relied on global 'window' for module resolution and lacked HMR. Upgrade to 2.x is required for HMR and modern webpack.","severity":"breaking","affected_versions":">=1.0.0 <2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install aurelia-loader' to install the peer dependency.","cause":"Missing peer dependency 'aurelia-loader'.","error":"Error: Cannot find module 'aurelia-loader'"},{"fix":"Use 'aurelia.container.registerSingleton(Loader, AureliaLoaderWebpack)' instead of 'aurelia.use.plugin(...)'.","cause":"Incorrect configuration; trying to register loader as a plugin instead of a singleton.","error":"TypeError: aurelia.use.plugin is not a function"},{"fix":"Run 'npm install aurelia-loader-webpack' and check your webpack resolve configuration.","cause":"The package is not installed or not resolved correctly.","error":"Module not found: Error: Can't resolve 'aurelia-loader-webpack' in ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}