1.0.2 • Published 6 months ago

rollup-plugin-minimize v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

1.0.2

6 months ago

1.0.1

6 months ago