diff --git a/README.md b/README.md index f9d62dd..d000de0 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ module.exports = { } ``` +Since version 0.4.1: switched to maintained fork of `ng-annotate`: [ng-annotate-patched](https://github.com/bluetech/ng-annotate-patched) to benefit from its improvements. + Since version 0.4.0: for performance reasons, chunks where the name starts with `vendors~` are not annotated. To customize this behavior, set the option `annotateChunk` to a method that returns `true` if a chunk should be annotated: diff --git a/index.js b/index.js index 1005256..1eab7d5 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ -var ngAnnotate = require('ng-annotate'), - SourceMapSource = require('webpack-core/lib/SourceMapSource'); +var ngAnnotate = require('ng-annotate-patched'), + SourceMapSource = require('webpack-core/lib/SourceMapSource'), + OriginalSource = require('webpack-core/lib/OriginalSource'); function ngAnnotatePlugin(options) { this.options = options || { add: true, sourceMap: false }; @@ -47,9 +48,12 @@ ngAnnotatePlugin.prototype.apply = function apply(compiler) { if (options.sourceMap && asset.sourceAndMap) { compilation.assets[file] = new SourceMapSource(value.src, file, JSON.parse(value.map), input, map); } - else { + else if (map) { compilation.assets[file] = new SourceMapSource(value.src, file, map); } + else { + compilation.assets[file] = new OriginalSource(value.src, file); + } } } diff --git a/package.json b/package.json index 1a0010d..febca82 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ng-annotate-webpack-plugin", - "version": "0.4.0", - "description": "webpack plugin that runs ng-annotate on your bundles", + "version": "0.5.0", + "description": "webpack plugin that runs ng-annotate-patched on your bundles", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/cliechty/ng-annotate-webpack-plugin", "dependencies": { - "ng-annotate": "^1.2.1", - "webpack-core": "^0.6.5" + "ng-annotate-patched": "^1.13.0", + "webpack-core": "^0.6.9" } }