You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rollup-plugin-minify-es

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-minify-es

Rollup plugin to minify generated format into new minified file, with source maps, using uglify-es.

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
351
-61.09%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-minify-es [![Travis Build Status][travis-img]][travis]

Rollup plugin to minify generated bundle.

Install

npm i rollup-plugin-minify-es -D

Usage

import { rollup } from 'rollup';
import minify from 'rollup-plugin-minify-es';

rollup({
    entry: 'main.js',
    plugins: [
        minify()
    ]
});

Options

minify(options)

options – default: {}, type: object. UglifyJS API options

minifier – default: require('minify-js').minify, type: function. Module to use as a minifier. You can use other versions (or forks) of UglifyJS instead default one.

import { rollup } from 'rollup';
import minify from 'rollup-plugin-minify';
import { minify } from 'minify-es';

rollup({
    entry: 'main.js',
    plugins: [
        minify({}, minify)
    ]
});

Examples

Comments

If you'd like to preserve comments (for licensing for example), then you can specify a function to do this like so:

minify({
  output: {
    comments: function(node, comment) {
        var text = comment.value;
        var type = comment.type;
        if (type == "comment2") {
            // multiline comment
            return /@preserve|@license|@cc_on/i.test(text);
        }
    }
  }
});

See UglifyJS documentation for further reference.

License

MIT

Keywords

rollup

FAQs

Package last updated on 15 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.