All Projects → gdborton → Webpack Parallel Uglify Plugin

gdborton / Webpack Parallel Uglify Plugin

A faster uglifyjs plugin.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Webpack Parallel Uglify Plugin

Dotenv Webpack
A secure webpack plugin that supports dotenv and other environment variables and only exposes what you choose and use.
Stars: ✭ 1,022 (+124.12%)
Mutual labels:  webpack, webpack-plugin, plugin
Webpack Alioss Plugin
阿里 oss-webpack 自动上传插件
Stars: ✭ 35 (-92.32%)
Mutual labels:  webpack, webpack-plugin, plugin
Offline Plugin
Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
Stars: ✭ 4,444 (+874.56%)
Mutual labels:  webpack, webpack-plugin, plugin
Fork Ts Checker Webpack Plugin
Webpack plugin that runs typescript type checker on a separate process.
Stars: ✭ 1,343 (+194.52%)
Mutual labels:  webpack, webpack-plugin, plugin
Webpack Ops
📁 webpack bundle visualization // optimization // config tool
Stars: ✭ 251 (-44.96%)
Mutual labels:  webpack, plugin
Webpack Shell Plugin
Run shell commands either before or after webpack builds
Stars: ✭ 250 (-45.18%)
Mutual labels:  webpack, webpack-plugin
Webpack Virtual Modules
Webpack Virtual Modules is a webpack plugin that lets you create, modify, and delete in-memory files in a way that webpack treats them as if they were physically presented in the file system.
Stars: ✭ 286 (-37.28%)
Mutual labels:  webpack, webpack-plugin
Filemanager Webpack Plugin
Copy, move, archive (zip/tar/tar.gz), delete files and directories before and after Webpack builds. Win32/Mac/*Nix supported
Stars: ✭ 310 (-32.02%)
Mutual labels:  webpack, webpack-plugin
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+487.5%)
Mutual labels:  webpack, webpack-plugin
Webpack Sentry Plugin
Webpack plugin to upload source maps to Sentry
Stars: ✭ 299 (-34.43%)
Mutual labels:  webpack, webpack-plugin
Web Webpack Plugin
alternative for html-webpack-plugin
Stars: ✭ 318 (-30.26%)
Mutual labels:  webpack, webpack-plugin
Webpack Fix Style Only Entries
Webpack plugin to solve the problem of having a style only entry (css/sass/less) generating an extra js file.
Stars: ✭ 250 (-45.18%)
Mutual labels:  webpack, plugin
Grunt Webpack
integrate webpack into grunt build process
Stars: ✭ 249 (-45.39%)
Mutual labels:  webpack, plugin
Webpack Assets Manifest
This Webpack plugin will generate a JSON file that matches the original filename with the hashed version.
Stars: ✭ 269 (-41.01%)
Mutual labels:  webpack, webpack-plugin
Webpack Messages
Beautifully format Webpack messages throughout your bundle lifecycle(s)!
Stars: ✭ 238 (-47.81%)
Mutual labels:  webpack, webpack-plugin
Webpack Cdn Plugin
A webpack plugin that use externals of CDN urls for production and local node_modules for development
Stars: ✭ 306 (-32.89%)
Mutual labels:  webpack, webpack-plugin
Webpack Chrome Extension Reloader
🔥 Hot reloading while developing Chrome extensions with webpack 🔥
Stars: ✭ 365 (-19.96%)
Mutual labels:  webpack, webpack-plugin
Browser Sync Webpack Plugin
Easily use BrowserSync in your Webpack project.
Stars: ✭ 356 (-21.93%)
Mutual labels:  webpack, webpack-plugin
Miox
Modern infrastructure of complex SPA
Stars: ✭ 374 (-17.98%)
Mutual labels:  webpack, plugin
Webpack Pwa Manifest
Progressive Web App Manifest Generator for Webpack, with auto icon resizing and fingerprinting support.
Stars: ✭ 447 (-1.97%)
Mutual labels:  webpack, plugin

webpack-parallel-uglify-plugin Build status Coverage Status

This plugin serves to help projects with many entry points speed up their builds. The UglifyJS plugin provided with webpack runs sequentially on each of the output files. This plugin runs uglify in parallel with one thread for each of your available cpus. This can lead to significantly reduced build times as minification is very CPU intensive.

Config

Configuring is straightforward.

import ParallelUglifyPlugin from 'webpack-parallel-uglify-plugin';

module.exports = {
  plugins: [
    new ParallelUglifyPlugin({
      // Optional regex, or array of regex to match file against. Only matching files get minified.
      // Defaults to /.js$/, any file ending in .js.
      test,
      include, // Optional regex, or array of regex to include in minification. Only matching files get minified.
      exclude, // Optional regex, or array of regex to exclude from minification. Matching files are not minified.
      cacheDir, // Optional absolute path to use as a cache. If not provided, caching will not be used.
      workerCount, // Optional int. Number of workers to run uglify. Defaults to num of cpus - 1 or asset count (whichever is smaller)
      sourceMap, // Optional Boolean. This slows down the compilation. Defaults to false.
      uglifyJS: {
        // These pass straight through to [email protected]
        // Cannot be used with terser.
        // Defaults to {} if not neither uglifyJS or terser are provided.
        // You should use this option if you need to ensure es5 support. uglify-js will produce an
        // error message if it comes across any es6 code that it can't parse.
      },
      terser: {
        // These pass straight through to terser.
        // Cannot be used with uglifyJS.
        // terser is a fork of uglify-es, a version of uglify that supports ES6+ version of uglify
        // that understands newer es6 syntax. You should use this option if the files that you're
        // minifying do not need to run in older browsers/versions of node.
      }
    }),
  ],
};

Example Timings

These times were found by running webpack on a very large build, producing 493 output files and totaling 144.24 MiB before minifying. All times are listed with fully cached babel-loader for consistency.

Note: I no longer have access to the huge project that I was testing this on.

No minification: Webpack build complete in: 86890ms (1m 26s)
Built in uglify plugin: Webpack build complete in: 2543548ms (42m 23s)
With parallel plugin: Webpack build complete in: 208671ms (3m 28s)
With parallel/cache: Webpack build complete in: 98524ms (1m 38s)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].