Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit defeca1

Browse files
squash: styling
1 parent 3dd452b commit defeca1

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

README.md

+10-17
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,11 @@ npm install uglifyjs-webpack-plugin --save-dev
2424
yarn add uglifyjs-webpack-plugin --dev
2525
```
2626

27-
⚠️ The plugin has a peer dependency to uglify-js, so in order to use the plugin, also uglify-js has to be installed. The currently (2017/1/25) available uglify-js npm packages; however, do not support minification of ES6 code. In order to support ES6, an ES6-capable, a.k.a. _harmony_, version of UglifyJS has to be provided.
28-
29-
If your minification target is ES6:
30-
31-
```bash
32-
yarn add git://github.com/mishoo/UglifyJS2#harmony-v2.8.22 --dev
33-
```
34-
35-
If your minification target is ES5:
27+
> ⚠️ The plugin has a peer dependency to uglify-es (UglifyJS), so in order to use the plugin, also uglify-js has to be installed.
3628
3729
```bash
38-
yarn add uglify-js --dev
30+
npm install uglify-es --save-dev
31+
yarn add uglify-es --dev
3932
```
4033

4134
<h2 align="center">Usage</h2>
@@ -58,19 +51,19 @@ This plugin supports UglifyJS features as discussed below:
5851
|Name|Type|Default|Description|
5952
|:--:|:--:|:-----:|:----------|
6053
|**`compress`**|`{Boolean\|Object}`|`true`|See [UglifyJS documentation](http://lisperator.net/uglifyjs/compress)|
61-
|**`mangle`**|`{Boolean\|Object}`|`true`|See |
54+
|**`mangle`**|`{Boolean\|Object}`|`true`|See [below](https://github.com/webpack-contrib/uglifyjs-webpack-plugin/tree/readme#mangle)|
6255
|**`beautify`**|`{Boolean}`|`false`|Beautify output|
6356
|**`output`**|`{Object}`|`{}`|An object providing options for UglifyJS [OutputStream](https://github.com/mishoo/UglifyJS2/blob/v2.x/lib/output.js) (Lower level access to `Uglifyjs` output)|
64-
|**`comments`**|{Boolean\|RegExp\|Function<(node, comment) -> {Boolean}>}`| Defaults to preserving comments containing `/*!`, `/**!`, `@preserve` or `@license`. | Comment related configuration. |
65-
|**`extractComments`**|{Boolean\|RegExp}\|Function<(node, comment) -> {Boolean\|Object}}`|`false`| Whether comments shall be extracted to a separate file, (see [details](https://github.com/webpack/webpack/commit/71933e979e51c533b432658d5e37917f9e71595a), since webpack 2.3.0)|
57+
|**`comments`**|`{Boolean\|RegExp\|Function<(node, comment) -> {Boolean}>}`| Defaults to preserving comments containing `/*!`, `/**!`, `@preserve` or `@license`. |Comment related configuration|
58+
|**`extractComments`**|`{Boolean\|RegExp\|Function<(node, comment) -> {Boolean\|Object}>}`|`false`| Whether comments shall be extracted to a separate file, (see [details](https://github.com/webpack/webpack/commit/71933e979e51c533b432658d5e37917f9e71595a), since webpack 2.3.0)|
6659
|**`sourceMap`**|`{Boolean}`|`false`|Use SourceMaps to map error message locations to modules. This slows down the compilation. ⚠️ **`cheap-source-map` options don't work with the plugin!**|
6760
|**`test`**|`{RegExp\|Array<RegExp>}`| <code>/\.js($&#124;\?)/i</code> |Test to match files against|
68-
|**`include`**|`{RegExp\|Array<RegExp>}|`undefined`|Test only `include` files|
69-
|**`exclude`**|`{RegExp\|Array<RegExp>}|`undefined`|Files to `exclude` from testing|
61+
|**`include`**|`{RegExp\|Array<RegExp>}`|`undefined`|Test only `include` files|
62+
|**`exclude`**|`{RegExp\|Array<RegExp>}`|`undefined`|Files to `exclude` from testing|
7063
|**`warningsFilter`**|{`Function(source) -> {Boolean}}`|``|Allow to filter uglify warnings (since webpack 2.3.0)|
7164

7265

73-
### `Mangling`
66+
### `mangle`
7467

7568
`mangle (boolean|object)` - Passing `true` or an object enables and provides options for UglifyJS name mangling. See [UglifyJS documentation](https://github.com/mishoo/UglifyJS2/tree/v2.x#mangle) for mangle options. Example configuration, this will **not** mangle properties (see below):
7669

@@ -97,7 +90,7 @@ new UglifyJsPlugin({
9790
})
9891
```
9992

100-
### `Extracting Comments`
93+
### `extractComments`
10194

10295
The `extractComments` option can be
10396
- `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`

0 commit comments

Comments
 (0)