RReverser/babel-plugin-uglify


UglifyJS integration for Babel

License: MIT

Language: JavaScript


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']
});

Project Statistics

Sourcerank 10
Repository Size 3.91 KB
Stars 47
Forks 6
Watchers 3
Open issues 2
Dependencies 6
Contributors 2
Tags 0
Created
Last updated
Last pushed

Top Contributors See all

Ingvar Stepanyan Eugene Kuzmenko

Packages Referencing this Repo

babel-plugin-uglify
UglifyJS integration for Babel
Latest release 1.0.2 - Updated - 47 stars
babel-plugin-uglify-siuying
UglifyJS integration for Babel
Latest release 2.0.0 - Published - 47 stars
siuying-babel-plugin-uglify
UglifyJS integration for Babel
Latest release 1.0.3 - Published - 47 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-02-26 18:26:58 UTC

Login to resync this repository