Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sorrycc/esbuild-webpack-plugin
Use esbuild as minifier for webpack.
https://github.com/sorrycc/esbuild-webpack-plugin
Last synced: 5 days ago
JSON representation
Use esbuild as minifier for webpack.
- Host: GitHub
- URL: https://github.com/sorrycc/esbuild-webpack-plugin
- Owner: sorrycc
- Created: 2020-05-06T14:02:14.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-19T10:07:32.000Z (over 3 years ago)
- Last Synced: 2025-01-31T02:20:05.040Z (13 days ago)
- Language: TypeScript
- Homepage:
- Size: 43.9 KB
- Stars: 263
- Watchers: 7
- Forks: 22
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-esbuild - esbuild-webpack-plugin
README
# esbuild-webpack-plugin
Use [esbuild](https://github.com/evanw/esbuild) as minifier for webpack.
## Why is this package?
[彻底告别编译 OOM,用 esbuild 做压缩器](https://zhuanlan.zhihu.com/p/139219361)。
## Install
```bash
$ yarn add esbuild-webpack-plugin --dev
```## Webpack config
```js
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
```shell script
# 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