Socket
Book a DemoInstallSign in
Socket

fast-uglifyjs-plugin

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-uglifyjs-plugin

hight performance uglify plugin for webpack

0.3.0
latest
Source
npmnpm
Version published
Weekly downloads
19
72.73%
Maintainers
3
Weekly downloads
 
Created
Source

有赞logo

FastUglifyJsPlugin

Introduction

中文文档

compatible with webpack 2

The uglify process of building project in production environment is very time consuming. It could take up to 70% of the build time. FastUglifyJsPlugin have multi-process and cache feature comparing to webpack's UglifyJsPlugin. Multi-process can utilize multicore cpu's caculation capability. Cache can minimize the need to complie code. Below is a set of performance testing data. FastUglifyJsPlugin has a way better performace.

plugintime
webpack.optimize.UglifyJsPlugin7.4 min
FastUglifyJsPlugin without cache4.45 min
FastUglifyJsPlugin with cache36 s

test sample:29 entry,2615 modules

test environment:MacBook Pro,4 core cpu,8g memory

Installation

npm i fast-uglifyjs-plugin --save

# or 

yarn add fast-uglifyjs-plugin

Configuration

FastUglifyJsPlugin is base on webpack.optimize.UglifyJsPlugin. They have the same usage except for a few extra configuration.

var FastUglifyJsPlugin = require('fast-uglifyjs-plugin');

module.exports = {
    entry: {...},
    output: {...},
    plugins: [new FastUglifyJsPlugin({
        compress: {
            warnings: false
        },
        // set debug as true to output detail cache information           
        debug: true,
        // enable cache by default to improve uglify performance. set false to turn it off
        cache: false,
        // root directory is the default cache path. it can be configured by following setting
        cacheFolder: path.resolve(__dirname, '.otherFolder'),
        // num of worker process default ,os.cpus().length
        workerNum: 2
    })]
};

Licence

MIT

Keywords

cache

FAQs

Package last updated on 23 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.