Skip to content

danrouse/rollup-plugin-bundle-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rollup-plugin-bundle-hash

Write rollup output content hashes to a file.

Installation

npm install --save-dev rollup-plugin-bundle-hash

Usage

Add this plugin at the end of your plugins array, after compiled assets are available for hashing. A hash of bundle contents will be written to a file.

// rollup.config.js
import bundleHash from 'rollup-plugin-bundle-hash';

export default {
  // ...
  plugins: [
    bundleHash('path/to/output.hash')
  ]
}

Options

A second argument can be passed with an array of paths to non-bundled assets that you want included in the content hash, for example CSS not handled by rollup.

bundleHash('output.hash', ['dist/bundle.css', 'dist/something'])

Why?

To provide a way to track bundle updates more accurately than checking bundle filesize or modification time. Rollup will touch output bundles even if they don't change, which can be annoying when live-reloading.

About

Write rollup output content hashes to a file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published