rollup-plugin-uglify
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "rollup-plugin-uglify", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Rollup plugin to minify generated bundle", | ||
"main": "dist/rollup-plugin-uglify.js", | ||
"jsnext:main": "dist/rollup-plugin-uglify.mjs", | ||
"module": "dist/rollup-plugin-uglify.es.js", | ||
"jsnext:main": "dist/rollup-plugin-uglify.es.js", | ||
"files": [ | ||
@@ -8,0 +9,0 @@ "dist" |
@@ -28,3 +28,14 @@ # rollup-plugin-uglify [![Travis Build Status][travis-img]][travis] | ||
## Options | ||
```js | ||
uglify(options, minifier) | ||
``` | ||
`options` – default: `{}`, type: `object`. [UglifyJS API options](https://github.com/mishoo/UglifyJS2#api-reference) | ||
`minifier` – default: `require('uglify-js').minify`, type: `function`. Module to use as a minifier. You can use other versions (or forks) of UglifyJS instead default one. | ||
## Warning | ||
[UglifyJS](https://github.com/mishoo/UglifyJS2), which this plugin is based on, does not support the ES2015 module syntax. Thus using this plugin with Rollup's default bundle format (`'es6'`) will not work and error out. | ||
@@ -35,3 +46,3 @@ To work around this you can tell `rollup-plugin-uglify` to use the UglifyJS [harmony branch](https://github.com/mishoo/UglifyJS2/tree/harmony) by passing its `minify` function to minify your code. | ||
import uglify from 'rollup-plugin-uglify'; | ||
import { minify } from 'uglify-js'; | ||
import { minify } from 'uglify-js-harmony'; | ||
@@ -46,2 +57,6 @@ rollup({ | ||
To install the experimental version of UglifyJS: | ||
npm i -D uglify-js-harmony | ||
## Examples | ||
@@ -68,4 +83,6 @@ | ||
See [UglifyJS documentation](https://github.com/mishoo/UglifyJS2#keeping-comments-in-the-output) for further reference. | ||
# License | ||
MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru) |
5962
85