rollup-plugin-minimize
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

rollup-plugin-minimize Travis Build Status

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?

  1. Module is a namespace. Default export often leads to function/component per file dogma and makes code less maintainable.
  2. Interop with commonjs is broken in many cases or hard to maintain.
  3. Show me any good language with default exports. It's historical javascriptism.

License

MIT © Allex Wang

Package Sidebar

Install

npm i rollup-plugin-minimize

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

20.7 kB

Total Files

12

Last publish

Collaborators

  • allex