diff --git a/README.md b/README.md index 67582c7..bde8e32 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,22 @@ module: { } ``` +#### Using a fork of ng-annotate: + +```js +{ + test: /src.*\.js$/, + use: [ + { + loader: 'ng-annotate-loader', + options: { + ngAnnotate: 'my-ng-annotate-fork' + } + } + ] +} +``` + #### Works great with js compilers, `babel` for example: ```js diff --git a/loader.js b/loader.js index d5023f4..c120837 100644 --- a/loader.js +++ b/loader.js @@ -1,4 +1,3 @@ -var ngAnnotate = require('ng-annotate'); var utils = require('loader-utils'); var SourceMapConsumer = require('source-map').SourceMapConsumer; var SourceMapGenerator = require('source-map').SourceMapGenerator; @@ -73,6 +72,7 @@ module.exports = function(source, inputSourceMap) { var filename = normalizePath(this.resourcePath); this.cacheable && this.cacheable(); + var ngAnnotate = require((utils.getOptions(this) || {}).ngAnnotate || 'ng-annotate'); var annotateResult = ngAnnotate(source, getOptions.call(this, sourceMapEnabled, filename)); if (annotateResult.errors) {