Registry / web-framework / aurelia-loader-webpack

aurelia-loader-webpack

JSON →
library2.2.5jsnpmunverified

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.

npm install aurelia-loader-webpack
INSTALL
IMPORT
SIG · AURELIA-LOADER-WEB
A
aurelia-loader-webpack
web-frameworkjavascriptv2.2.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AureliaLoaderWebpack
import { AureliaLoaderWebpack } from 'aurelia-loader-webpack';
import AureliaLoaderWebpack from 'aurelia-loader-webpack';
Requires a named import; default import is not supported.
Loader
import { Loader } from 'aurelia-loader';
import { Loader } from 'aurelia-loader-webpack';
The base Loader class is in 'aurelia-loader', not in this package. webpack-loader implements it.
WebpackLoader
import { WebpackLoader } from 'aurelia-loader-webpack';
import { WebpackLoader } from 'aurelia-loader';
WebpackLoader is an alias for AureliaLoaderWebpack, exported for convenience.

Shows how to register the AureliaLoaderWebpack in an Aurelia application and use PLATFORM.moduleName for module resolution.

import { Aurelia } from 'aurelia-framework'; import { AureliaLoaderWebpack } from 'aurelia-loader-webpack'; import { PLATFORM } from 'aurelia-pal'; // In your Aurelia configuration file: export function configure(aurelia: Aurelia): void { aurelia.use .standardConfiguration() .developmentLogging(); // Register the webpack loader aurelia.container.registerSingleton(Loader, AureliaLoaderWebpack); aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app'))); }
Debug
Known issues
breakingVersion 2.0.0 is a complete rewrite with a new universal bootstrapper and HMR support. It is not backward compatible with 1.x.
fix
Update your bootstrapping code to use the new loader API. Refer to the Aurelia 2 migration guide.
affects: >=2.0.0 <3.0.0
gotchaWhen using css-loader v4, you may encounter compatibility issues. The fix was released in version 2.2.2.
fix
Upgrade to aurelia-loader-webpack@2.2.2 or later.
affects: >=2.2.0 <2.2.2
gotchaThe eachModule iteration shortcircuits when the callback returns true. This may cause unexpected behavior if you don't expect return values to stop iteration.
fix
Do not return true from the eachModule callback unless you intend to stop iteration.
affects: >=2.2.1
deprecatedThe export 'WebpackLoader' may be deprecated in future versions; prefer 'AureliaLoaderWebpack'.
fix
Use 'AureliaLoaderWebpack' instead of 'WebpackLoader' in imports.
affects: >=2.0.0
breakingVersion 1.x relied on global 'window' for module resolution and lacked HMR. Upgrade to 2.x is required for HMR and modern webpack.
fix
Migrate to version 2.x and update your bootstrapper.
affects: >=1.0.0 <2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'aurelia-loader'
Missing peer dependency 'aurelia-loader'.
fix
Run 'npm install aurelia-loader' to install the peer dependency.
TypeError: aurelia.use.plugin is not a function
Incorrect configuration; trying to register loader as a plugin instead of a singleton.
fix
Use 'aurelia.container.registerSingleton(Loader, AureliaLoaderWebpack)' instead of 'aurelia.use.plugin(...)'.
Module not found: Error: Can't resolve 'aurelia-loader-webpack' in ...
The package is not installed or not resolved correctly.
fix
Run 'npm install aurelia-loader-webpack' and check your webpack resolve configuration.
Upgrade
Version history
2.2.5latest on npm
Audit
Dependencies
aurelia-loaderrequiredProvides the core loader interface that this implementation extends.
webpackrequiredRequired as a peer dependency; this loader integrates with webpack's module system.
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
aurelia-loader-webpack — npm install aurelia-loader-webpack · libregistry