/esbuild-plugin-gzip

Gzip and Brotli compression for esbuild

Primary LanguageJavaScriptDo What The F*ck You Want To Public LicenseWTFPL

esbuild-plugin-gzip

Gzip and Brotli compression for esbuild.

Installation

$ npm i -D esbuild @luncheon/esbuild-plugin-gzip

Usage Example

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

gzipPlugin({
  uncompressed: true,
  gzip: true,
  brotli: true,
  onEnd: ({ outputFiles }) => {
    // outputFiles.forEach(({ path, contents }) => {})
  }
})

License

WTFPL