# pro-uglifyjs-webpack-plugin

> uglifyjs-webpack-plugin with wrapCatch option

Latest version **1.1.1** (published 2017-06-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install pro-uglifyjs-webpack-plugin
pnpm add pro-uglifyjs-webpack-plugin
yarn add pro-uglifyjs-webpack-plugin
bun add pro-uglifyjs-webpack-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2017-06-28 |
| First published | 2017-06-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | MichaelHu |
| Maintainers | michaelhu |

## Links

- npm: https://www.npmjs.com/package/pro-uglifyjs-webpack-plugin
- Repository: https://github.com/MichaelHu/pro-uglifyjs-webpack-plugin
- Homepage: https://github.com/MichaelHu/pro-uglifyjs-webpack-plugin#readme
- Issues: https://github.com/MichaelHu/pro-uglifyjs-webpack-plugin/issues
- npm.io page: https://npm.io/package/pro-uglifyjs-webpack-plugin

## Recent versions

- 1.1.1 (latest) — 2017-06-28
- 1.1.0 — 2017-06-27
- 1.0.38 — 2017-06-27
- 1.0.30 — 2017-06-22

## README

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

---
_Source: https://npm.io/package/pro-uglifyjs-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
