1.1.2 • Published 6 months ago

@wwa/rollup-plugin-terser v1.1.2

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

rollup-plugin-terser

Build and Test Quality Gate Status CodeQL Analysis Dependency Review

A Rollup plugin to minify the generated bundle with Terser.

This is a complete rewrite of TrySound/rollup-plugin-terser.

Main differences:

  • the code is written in TypeScript;
  • this plugin supports both Rollup 2 and Rollup 3;
  • the implementation is more lightweight and probably less resource-consuming, but it does not use workers (therefore, it could be slower).

Installation

npm i -D @wwa/rollup-plugin-terser

Usage

import { rollup } from 'rollup';
import { terser } from '@wwa/rollup-plugin-terser';

rollup({
  input: 'file.js',
  plugins: [
    terser(),
  ],
});

terser accepts an optional options parameter, which is the MinifyOptions object.

The plugin automatically sets the following options:

  • module: true if the output format is esm or es;
  • toplevel: true if the output format is cjs;
  • sourcemap is always inferred from rollup's options.
1.1.1

7 months ago

1.1.2

6 months ago

1.0.1

2 years ago

1.0.0

2 years ago