@rollup/plugin-terser
Generate minified bundle
Last updated 2 years ago by shellscape .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @rollup/plugin-terser 
SYNC missed versions from official npm registry.

npm size libera manifesto

@rollup/plugin-terser

🍣 A Rollup plugin to generate a minified bundle with terser.

Requirements

This plugin requires an LTS Node version (v14.0.0+) and Rollup v2.0+.

Install

Using npm:

npm install @rollup/plugin-terser --save-dev

Usage

Create a rollup.config.js configuration file and import the plugin:

import terser from '@rollup/plugin-terser';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [terser()]
};

Then call rollup either via the CLI or the API.

Options

The plugin accepts a terser Options object as input parameter, to modify the default behaviour.

In addition to the terser options, it is also possible to provide the following options:

maxWorkers

Type: Number
Default: undefined

Instructs the plugin to use a specific amount of cpu threads.

import terser from '@rollup/plugin-terser';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [
    terser({
      maxWorkers: 4
    })
  ]
};

Meta

CONTRIBUTING

LICENSE (MIT)

Current Tags

  • 0.4.4                                ...           latest (a year ago)

9 Versions

  • 0.4.4                                ...           a year ago
  • 0.4.3                                ...           a year ago
  • 0.4.2                                ...           a year ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE