Registry / web-framework / ng-annotate-loader

ng-annotate-loader

JSON →
library0.7.0jsnpmunverified

A webpack loader that automatically adds AngularJS dependency injection annotations to your source code using ng-annotate. Version 0.7.0 is the latest stable release. It generates source maps by default and supports chaining with other loaders like babel-loader. Key features include passing ng-annotate options (add, map, etc.), using ng-annotate plugins, and specifying a custom ng-annotate fork. This loader is specific to AngularJS (1.x) and webpack 1.x/2.x/3.x; for newer Angular versions, consider using the Angular CLI or other DI mechanisms.

npm install ng-annotate-loader
INSTALL
IMPORT
SIG · NG-ANNOTATE-LOADER
N
ng-annotate-loader
web-frameworkjavascriptv0.7.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

default
✓ import ngAnnotateLoader from 'ng-annotate-loader'
✗ const ngAnnotateLoader = require('ng-annotate-loader')
This loader is typically used via webpack config, not imported directly.

Configures webpack to run ng-annotate-loader before babel-loader on JavaScript files, enabling automatic AngularJS DI annotation.

// webpack.config.js module.exports = { module: { rules: [ { test: /\.js$/, use: [ { loader: 'ng-annotate-loader', options: { add: true, map: false } }, 'babel-loader' ] } ] } };
Debug
Known issues
deprecatedng-annotate itself is no longer actively maintained. For AngularJS (1.x), consider using babel-plugin-angularjs-annotate instead.
fix
Replace with babel-plugin-angularjs-annotate in your babel configuration.
affects: >=0.7.0
breakingWebpack 4+ changed the loader invocation method. This loader may not work with webpack 4 without configuration.
fix
Use webpack 3 or earlier, or check for a maintained fork.
affects: 0.6.0 - 0.7.0
gotchaChaining loaders: ng-annotate-loader must run before other transpilers (e.g., babel) to avoid syntax errors from ng-annotate injecting code that isn't transpiled.
fix
Ensure ng-annotate-loader appears before babel-loader in the rules array.
affects: >=0.0.1
Errors
Common errors & fixes
Module not found: Error: Cannot resolve module 'ng-annotate-loader'
ng-annotate-loader is not installed or the path is incorrect.
fix
Run 'npm install --save-dev ng-annotate-loader' and ensure it's in your package.json.
ERROR in ng-annotate-loader: Could not find ng-annotate module
The loader cannot resolve the 'ng-annotate' dependency.
fix
Make sure 'ng-annotate' is installed: 'npm install --save-dev ng-annotate'.
Source map issue: source-map library version mismatch
Incompatible version of source-map maybe installed.
fix
Install a compatible version: 'npm install source-map@0.5.6'.
Upgrade
Version history
0.7.0latest on npm
Audit
Dependencies
ng-annotaterequiredCore annotation library; the loader invokes ng-annotate to process files.
Agent activity
6 hits · last 30 days
node
6
Resources
ng-annotate-loader — npm install ng-annotate-loader · libregistry