rollup-plugin-hash-n-gzip
Hash and gzip outputs. Updated for Rollup 0.64+.
Used for static serving of gzip compressed files with filename based cache busting and source integrity calculation.
Combine with rollup-plugin-web-build-events for an integrated live-reload development experience.
Example
Generate a static public/
folder with gzip'd files and a preprocessed public/index.html
and public/dynamic.json
.
Then serve with packages like express-static-gzip or koa-static.
const plugins = input: 'src/main-a.js' 'src/main-b.js' output: dir: 'public/module' format: 'es' sourcemap: true plugins experimentalCodeSplitting: true let tid { Object console // debounce rebuilding depenent outputs as necessary. (e.g. index.html) tid = } { fs // Or use a templating engine here const index_html = `\<!doctype html><head> <title>rollup-plugin-hash-n-gzip example</title> <script type=module src=''></script> <script type=module src=''></script></head><body> Look in your inspector</body>` fs}
Rollup Plugin Options
const plugins =
License
Some code inspired and/or sourced from: