README
@lopatnov/rollup-plugin-uglify
A rollup plugin to minify javascript
Requirements
Install rollup and terser first.
npm install rollup --save-dev
npm install terser --save-dev
Install
npm install @lopatnov/rollup-plugin-uglify --save-dev
Import package to the project
TypeScript
import uglify from "@lopatnov/rollup-plugin-uglify";
JavaScript
var uglify = require("@lopatnov/rollup-plugin-uglify");
How to use plugin
File rollup.config.ts
export default {
//...
plugins: [
//...
uglify()
]
};
with options
export default {
//...
plugins: [
//...
uglify({
//options: IUglifyOptions
})
]
};
Options
uglify
function has optional argument options: IUglifyOptions
.
IUglifyOptions
is an interface, that extends MinifyOptions
of terser
package.
IUglifyOptions
contains:
include?: string | RegExp
exclude?: string | RegExp
A valid minimatch pattern, or array of patterns to include / exclude files. If include
is omitted or has zero length, filter will return true by default. Otherwise, an ID must match one or more of the minimatch patterns, and must not match any of the exclude
patterns.
Rights and Agreements
License Apache-2.0
Copyright 2019-2021 Oleksandr Lopatnov