rollup-plugin-minimize
v1.0.2
Published
A Rollup plugin to bundle with a minimize with checksum with md5 digest
Downloads
4
Maintainers
Readme
rollup-plugin-minimize
A Rollup plugin to bundle with a minimize with checksum with md5 digest, based on @rollup/plugin-terser.
Install
yarn add rollup-plugin-minimize --dev
This plugin requires an LTS Node version (v14.0.0+) and Rollup v2.78.0+.
Usage
import { rollup } from "rollup";
import { minimize } from "rollup-plugin-minimize";
rollup({
input: "main.js",
plugins: [minimize({
implementation: require('@rollup/plugin-terser'),
// options for rollup-plugin-terser <https://github.com/terser/terser>
options: {
ie8: true,
compress: {
drop_console: true
},
output: {
shebang: true,
indent_level: 2
},
module: true,
ecma: 2017,
toplevel: true
}
})]
});
Why named export?
- Module is a namespace. Default export often leads to function/component per file dogma and makes code less maintainable.
- Interop with commonjs is broken in many cases or hard to maintain.
- Show me any good language with default exports. It's historical javascriptism.
License
MIT © Allex Wang