Giter VIP home page Giter VIP logo

fast-uglifyjs-plugin's Introduction

有赞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.

plugin time
webpack.optimize.UglifyJsPlugin 7.4 min
FastUglifyJsPlugin without cache 4.45 min
FastUglifyJsPlugin with cache 36 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

fast-uglifyjs-plugin's People

Contributors

aui avatar dickenslian avatar keller35 avatar originalhat avatar panwenhua avatar vinnyguitar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fast-uglifyjs-plugin's Issues

缓存文件清除问题

使用插件build过程中产生了大量的缓存map文件,但是插件好像没有提供清理无用缓存文件的功能,这会导致缓存文件越来越大

sourcemap失效

使用内置uglify plugin是有sourcemap的,
替换后发现失效了。
不知道是否我配置方面有问题?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.