UglifyJS integration for Babel
Switch branches/tags
Nothing to show
Clone or download
RReverser Merge pull request #4 from thealjey/patch-1
Return a plain object to support Babel 6.
Latest commit 129cc6b Dec 3, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Return a plain object to support Babel 6 Nov 4, 2015
test Working version. Jul 30, 2015
.babelrc Working version. Jul 30, 2015
.editorconfig Working version. Jul 30, 2015
.gitignore Working version. Jul 30, 2015
.npmignore Working version. Jul 30, 2015
LICENSE Initial commit Jul 30, 2015
README.md Working version. Jul 30, 2015
package.json Micro-optimize location fixer a little bit. Jul 30, 2015

README.md

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