Skip to content

luncheon/esbuild-plugin-gzip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Gzip and Brotli compression for esbuild

Topics

Resources

License

Stars

Watchers

Forks