All Projects → developit → Optimize Plugin

developit / Optimize Plugin

Licence: apache-2.0
Optimized Webpack Bundling for Everyone. Intro ⤵️

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Optimize 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 (-45.52%)
Mutual labels:  webpack, webpack-plugin
Babel Minify Webpack Plugin
[DEPRECATED] Babel Minify Webpack Plugin
Stars: ✭ 502 (-4.38%)
Mutual labels:  webpack, webpack-plugin
Webpack Sentry Plugin
Webpack plugin to upload source maps to Sentry
Stars: ✭ 299 (-43.05%)
Mutual labels:  webpack, webpack-plugin
Webpack Messages
Beautifully format Webpack messages throughout your bundle lifecycle(s)!
Stars: ✭ 238 (-54.67%)
Mutual labels:  webpack, webpack-plugin
Webpack Chrome Extension Reloader
🔥 Hot reloading while developing Chrome extensions with webpack 🔥
Stars: ✭ 365 (-30.48%)
Mutual labels:  webpack, webpack-plugin
Webpack Shell Plugin
Run shell commands either before or after webpack builds
Stars: ✭ 250 (-52.38%)
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 (-40.95%)
Mutual labels:  webpack, webpack-plugin
Unused Files Webpack Plugin
Glob all files that are not compiled by webpack under webpack's context
Stars: ✭ 210 (-60%)
Mutual labels:  webpack, webpack-plugin
Browser Sync Webpack Plugin
Easily use BrowserSync in your Webpack project.
Stars: ✭ 356 (-32.19%)
Mutual labels:  webpack, webpack-plugin
Webpack Extension Reloader
A upgrade from 🔥webpack-chrome-extension-reloader🔥, now on all browsers
Stars: ✭ 355 (-32.38%)
Mutual labels:  webpack, webpack-plugin
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+410.29%)
Mutual labels:  webpack, webpack-plugin
Webpack Parallel Uglify Plugin
A faster uglifyjs plugin.
Stars: ✭ 456 (-13.14%)
Mutual labels:  webpack, webpack-plugin
Critters
🦔 A Webpack plugin to inline your critical CSS and lazy-load the rest.
Stars: ✭ 2,894 (+451.24%)
Mutual labels:  webpack, webpack-plugin
Webpack Assets Manifest
This Webpack plugin will generate a JSON file that matches the original filename with the hashed version.
Stars: ✭ 269 (-48.76%)
Mutual labels:  webpack, webpack-plugin
Hard Source Webpack Plugin
www.npmjs.com/package/hard-source-webpack-plugin
Stars: ✭ 2,608 (+396.76%)
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 (-41.71%)
Mutual labels:  webpack, webpack-plugin
Wxapp Webpack Plugin
📦 微信小程序 webpack 插件
Stars: ✭ 185 (-64.76%)
Mutual labels:  webpack, webpack-plugin
Bundle Buddy Webpack Plugin
🐐🐐🐐🐐 bundle-buddy-webpack-plugin 🐐🐐🐐🐐
Stars: ✭ 199 (-62.1%)
Mutual labels:  webpack, webpack-plugin
Web Webpack Plugin
alternative for html-webpack-plugin
Stars: ✭ 318 (-39.43%)
Mutual labels:  webpack, webpack-plugin
Moment Locales Webpack Plugin
Easily remove unused Moment.js locales with webpack
Stars: ✭ 396 (-24.57%)
Mutual labels:  webpack, webpack-plugin

Optimize Plugin for Webpack

Optimize your code for modern browsers while still supporting the other 10%, increasing your build performance, reducing bundle size and improving output quality.

Put simply: it compiles code faster, better and smaller.

Features

  • Much faster than your current Webpack setup
  • Transparently optimizes all of your code
  • Automatically optimizes all of your dependencies
  • Compiles bundles for modern browsers (90%) and legacy browsers (10%)
  • Removes unnecessary polyfills, even when inlined into dependencies
  • Builds a highly-optimized automated polyfills bundle

Install

npm install --save-dev optimize-plugin

Usage

First, disable any existing configuration you have to Babel, minification, and module/nomodule.

Then, add OptimizePlugin to your Webpack plugins Array:

plugins: [
  new OptimizePlugin({
    // any options here
  })
]

Options

Option Type Description
concurrency number|false Maximum number of threads to use. Default: the number of available CPUs.
Pass false for single-threaded, sometimes faster for small projects.
sourceMap boolean|false Whether or not to produce source maps for the given input.
minify boolean|false Minify using Terser, if turned off only comments will be stripped.
downlevel boolean|true Produces a bundle for nomodule browsers. (IE11, ...)
modernize boolean|true Attempt to upgrade ES5 syntax to equivalent modern syntax.
verbose boolean|false Will log performance information and information about polyfills.
polyfillsFilename string|polyfills.legacy.js The name for the chunk containing polyfills for the legacy bundle.

How does this work?

Instead of running Babel on each individual source code file in your project, optimize-plugin transforms your entire application's bundled code. This means it can apply optimizations and transformations not only to your source, but to your dependencies - making polyfill extraction and reverse transpilation steps far more effective.

This setup also allows optimize-plugin to achieve better performance. All work is done in a background thread pool, and the same AST is re-used for modern and legacy transformations. Previous solutions for module/nomodule have generally relied running two complete compilation passes, which incurs enormous overhead since the entire graph is built and traversed multiple times. With optimize-plugin, bundling and transpilation are now a separate concerns: Webpack handles graph creation and reduction, then passes its bundles to Babel for transpilation.

License

Apache-2.0

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].