1.1.1 • Published 7 years ago

pro-uglifyjs-webpack-plugin v1.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

pro-uglifyjs-webpack-plugin

It's essentially a uglifyjs webpack plugin, but extended with extra option.

Overview

You can replace webpack.optimize.UglifyJsPlugin with this plugin. Besides common usage of uglifyjs, the new-added option wrapCatch enables you:

wrap eval:

...
eval( 'var a = 5; console.log( a )' );
...

=>

...
try {
    eval( 'var a = 5; console.log( a )' );
}
catch ( e ) {
    throw Error( e );
}
...

wrap function body:

function a() {
    // function body goes here
}

=> 

function a() {
    try {
        // function body goes here
    }
    catch ( e ) {
        throw Error( e );
    }
}

you should only set the tryCatch option to true.

Installation

npm install --save pro-uglifyjs-webpack-plugin

Usage

in webpack.config.js

var proUglify = require( 'pro-uglifyjs-webpack-plugin' );
config.plugins = config.plugins.concat( [
    new proUglify( {
        wrapTry: true,
        compress: { ... },
        mangle: false,
        output: {
            comments: true
        }
    } )
] );
1.1.1

7 years ago

1.1.0

7 years ago

1.0.38

7 years ago

1.0.30

7 years ago