esbuild-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

esbuild-webpack-plugin

Use esbuild as minifier for webpack.

Why is this package?

彻底告别编译 OOM,用 esbuild 做压缩器

Install

$ yarn add esbuild-webpack-plugin --dev

Webpack config

const ESBuildPlugin = require('esbuild-webpack-plugin').default;
 
module.exports = {
  optimization: {
    minimizer: [
      new ESBuildPlugin(),
      /**
       * Or customize ESBuild options like below:
       *
       * new ESBuildPlugin({target: "es5"}),
       *
       * For details, please refer: https://github.com/evanw/esbuild
       */
    ],
  },
};

Test

# Get prepared 
$ yarn && yarn build
 
# Minify with terser 
$ yarn build:example
 
# Minify with esbuild 
$ yarn build:example:esbuild
 
# Do not minify 
$ yarn build:example:nocompress

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i esbuild-webpack-plugin

Weekly Downloads

278

Version

1.1.0

License

MIT

Unpacked Size

10.8 kB

Total Files

9

Last publish

Collaborators

  • sorrycc