https://github.com/luncheon/esbuild-plugin-gzip
Gzip and Brotli compression for esbuild
https://github.com/luncheon/esbuild-plugin-gzip
esbuild esbuild-plugin
Last synced: 10 months ago
JSON representation
Gzip and Brotli compression for esbuild
- Host: GitHub
- URL: https://github.com/luncheon/esbuild-plugin-gzip
- Owner: luncheon
- License: wtfpl
- Created: 2021-04-27T04:43:10.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-27T04:56:02.000Z (about 5 years ago)
- Last Synced: 2024-05-30T16:51:17.294Z (about 2 years ago)
- Topics: esbuild, esbuild-plugin
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esbuild-plugin-gzip
Gzip and Brotli compression for [esbuild](https://esbuild.github.io/).
## Installation
```sh
$ npm i -D esbuild @luncheon/esbuild-plugin-gzip
```
## Usage Example
```js
const esbuild = require('esbuild')
const gzipPlugin = require('@luncheon/esbuild-plugin-gzip')
esbuild.build({
entryPoints: ['src/app.ts'],
outdir: 'dist',
bundle: true,
minify: true,
write: false, // write must be false
plugins: [gzipPlugin()],
})
```
## Options
```js
gzipPlugin({
uncompressed: true,
gzip: true,
brotli: true,
onEnd: ({ outputFiles }) => {
// outputFiles.forEach(({ path, contents }) => {})
}
})
```
## License
[WTFPL](http://www.wtfpl.net/)