Webpack loader to migrate from legacy @ngInject pre-minifier syntax to modern "ngInject" directive prologue syntax for AngularJS applications. Current stable version is 2.1.0 with low release cadence. Key differentiator: reliably detects and rewrites @ngInject annotations after transpilation, enabling gradual migration while working alongside ng-annotate-loader. Version 2.x streamlined the loader to focus solely on syntax migration, contrasting with version 1.x which overlapped ng-annotate functionality.
npm install nginject-loaderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure webpack to use nginject-loader as a pre-processor to ng-annotate-loader, with the deprecate option enabled.
Ensure you use ng-annotate-loader alongside nginject-loader for complete annotation. Remove any direct usage of version 1.x API.
Migrate your code to use "ngInject" directive prologue and eventually remove this loader to improve compile time.
In webpack config, place nginject-loader after transpilers and before ng-annotate in the loaders array.
Add ?deprecate or { deprecate: true } to enable warnings during migration.Use the loader via webpack module rules or inline loader syntax, e.g., require('!nginject-loader!./file.js').Update the source code to use "ngInject" directive prologue instead of @ngInject.