{"id":20234,"library":"ng-annotate-loader","title":"ng-annotate-loader","description":"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.","status":"active","version":"0.7.0","language":"javascript","source_language":"en","source_url":"https://github.com/huston007/ng-annotate-loader","tags":["javascript","webpack","ng-annotate","angular"],"install":[{"cmd":"npm install ng-annotate-loader","lang":"bash","label":"npm"},{"cmd":"yarn add ng-annotate-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add ng-annotate-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core annotation library; the loader invokes ng-annotate to process files.","package":"ng-annotate","optional":false}],"imports":[{"note":"This loader is typically used via webpack config, not imported directly.","wrong":"const ngAnnotateLoader = require('ng-annotate-loader')","symbol":"default","correct":"import ngAnnotateLoader from 'ng-annotate-loader'"}],"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        use: [\n          {\n            loader: 'ng-annotate-loader',\n            options: {\n              add: true,\n              map: false\n            }\n          },\n          'babel-loader'\n        ]\n      }\n    ]\n  }\n};","lang":"javascript","description":"Configures webpack to run ng-annotate-loader before babel-loader on JavaScript files, enabling automatic AngularJS DI annotation."},"warnings":[{"fix":"Replace with babel-plugin-angularjs-annotate in your babel configuration.","message":"ng-annotate itself is no longer actively maintained. For AngularJS (1.x), consider using babel-plugin-angularjs-annotate instead.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Use webpack 3 or earlier, or check for a maintained fork.","message":"Webpack 4+ changed the loader invocation method. This loader may not work with webpack 4 without configuration.","severity":"breaking","affected_versions":"0.6.0 - 0.7.0"},{"fix":"Ensure ng-annotate-loader appears before babel-loader in the rules array.","message":"Chaining 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.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.7.0':24 '1':76,80 'add':10,54 'angular':84,89,100 'angularj':11,75 'annot':3,14,22,52,60,68,99 'automat':9 'babel':44 'babel-load':43 'chain':38 'cli':90 'code':18 'consid':86 'custom':65 'default':35 'depend':12 'di':93 'etc':56 'featur':47 'fork':69 'generat':31 'includ':48 'inject':13 'javascript':95 'key':46 'latest':27 'like':42 'loader':4,7,41,45,71 'map':33,55 'mechan':94 'newer':83 'ng':2,21,51,59,67,98 'ng-annot':20,50,58,66,97 'ng-annotate-load':1 'option':53 'pass':49 'plugin':61 'releas':29 'sourc':17,32 'specif':73 'specifi':63 'stabl':28 'support':37 'use':19,57,87 'version':23,85 'webpack':6,79,96 'x':77 'x/2.x/3.x':81","created_at":"2026-04-25T11:22:02.436740+00:00","updated_at":"2026-04-25T11:22:02.436740+00:00","problems":[{"fix":"Run 'npm install --save-dev ng-annotate-loader' and ensure it's in your package.json.","cause":"ng-annotate-loader is not installed or the path is incorrect.","error":"Module not found: Error: Cannot resolve module 'ng-annotate-loader'"},{"fix":"Make sure 'ng-annotate' is installed: 'npm install --save-dev ng-annotate'.","cause":"The loader cannot resolve the 'ng-annotate' dependency.","error":"ERROR in ng-annotate-loader: Could not find ng-annotate module"},{"fix":"Install a compatible version: 'npm install source-map@0.5.6'.","cause":"Incompatible version of source-map maybe installed.","error":"Source map issue: source-map library version mismatch"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/huston007/ng-annotate-loader","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/ng-annotate-loader","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}