@wwa/rollup-plugin-terser
v1.1.2
Published
[![Build and Test](https://github.com/sjinks/rollup-plugin-terser/actions/workflows/ci.yml/badge.svg)](https://github.com/sjinks/rollup-plugin-terser/actions/workflows/ci.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?projec
Downloads
2,523
Readme
rollup-plugin-terser
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 isesm
ores
;toplevel: true
if the output format iscjs
;sourcemap
is always inferred from rollup's options.