uglifyjs-webpack-plugin
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -0,1 +1,6 @@ | ||
0.1.5 / 2017-02-15 | ||
================== | ||
* Docs - Add `extractComments` documentation. #7 | ||
0.1.4 / 2017-02-06 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -137,3 +137,8 @@ 'use strict'; | ||
stream = '' + stream; | ||
asset.__UglifyJsPlugin = compilation.assets[file] = map ? new SourceMapSource(stream, file, JSON.parse(map), input, inputSourceMap) : new RawSource(stream); | ||
var source = map ? new SourceMapSource(stream, file, JSON.parse(map), input, inputSourceMap) : new RawSource(stream); | ||
compilation.assets[file] = source; | ||
asset.__UglifyJsPlugin = source; | ||
if (warnings.length > 0) { | ||
@@ -140,0 +145,0 @@ compilation.warnings.push(new Error(file + ' from UglifyJs\n' + warnings.join('\n'))); |
{ | ||
"name": "uglifyjs-webpack-plugin", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "UglifyJS plugin for webpack", | ||
@@ -5,0 +5,0 @@ "main": "./dist", |
@@ -65,2 +65,3 @@ [![build status](https://secure.travis-ci.org/webpack-contrib/uglifyjs-webpack-plugin.svg)](http://travis-ci.org/webpack-contrib/uglifyjs-webpack-plugin) [![bitHound Score](https://www.bithound.io/github/webpack-contrib/uglifyjs-webpack-plugin/badges/score.svg)](https://www.bithound.io/github/webpack-contrib/uglifyjs-webpack-plugin) [![codecov](https://codecov.io/gh/webpack-contrib/uglifyjs-webpack-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/webpack-contrib/uglifyjs-webpack-plugin) | ||
| comments | boolean, RegExp, function(astNode, comment) -> boolean | Defaults to preserving comments containing `/*!`, `/**!`, `@preserve` or `@license`. | Comment related configuration. | | ||
| extractComments | boolean, RegExp, function (astNode, comment) -> boolean, object | false | Whether comments shall be extracted to a separate file, see below. | | ||
| sourceMap | boolean | false | Use SourceMaps to map error message locations to modules. This slows down the compilation. | | ||
@@ -86,4 +87,15 @@ | test | RegExp, Array<RegExp> | <code>/\.js($|\?)/i</code> | Test to match files against. | | ||
## Extracting Comments | ||
The `extractComments` option can be | ||
- `true`: All comments that normally would be preserved by the `comments` option will be moved to a separate file. If the original file is named `foo.js`, then the comments will be stored to `foo.js.LICENSE` | ||
- regular expression (given as `RegExp` or `string`) or a `function (astNode, comment) -> boolean`: | ||
All comments that match the given expression (resp. are evaluated to `true` by the function) will be extracted to the separate file. The `comments` option specifies whether the comment will be preserved, i.e. it is possible to preserve some comments (e.g. annotations) while extracting others or even preserving comments that have been extracted. | ||
- an `object` consisting of the following keys, all optional: | ||
- `condition`: regular expression or function (see previous point) | ||
- `filename`: The file where the extracted comments will be stored. Can be either a `string` or `function (string) -> string` which will be given the original filename. Default is to append the suffix `.LICENSE` to the original filename. | ||
- `banner`: The banner text that points to the extracted file and will be added on top of the original file. will be added to the original file. Can be `false` (no banner), a `string`, or a `function (string) -> string` that will be called with the filename where extracted comments have been stored. Will be wrapped into comment. | ||
Default: `/*! For license information please see foo.js.LICENSE */` | ||
## License | ||
MIT. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17969
182
100