Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

babel-plugin-uglify

1.0.2 • Public • Published

babel-plugin-uglify

UglifyJS integration for Babel.

It will allow you to integrate UglifyJS minifier into Babel pipeline without a need for generating code from Babel and parsing back into UglifyJS just to minify it and generate back again.

You can find a bit more detailed article on this in my blog.

Installation

$ npm install babel-plugin-uglify --save-dev

Usage

Note that plugin should be always runned after any ES6 transformers (use :after suffix as shown below), as UglifyJS doesn't understand ES6 at all, and thus will just break if you have anything left untransformed.

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["uglify:after"]
}

Via CLI

$ babel --plugins uglify:after script.js

Via Node API

require('babel').transform('code', {
  plugins: ['uglify:after']
});

install

npm i babel-plugin-uglify

Downloadsweekly downloads

1,017

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability