Skip to content

RReverser/babel-plugin-uglify

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

.babelrc

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

Via CLI

$ babel --plugins uglify:after script.js

Via Node API

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

About

UglifyJS integration for Babel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published