webpack-hash

0.0.1 • Public • Published

Webpack Hash

A simple Webpack plugin that changes how files are hashed. Webpack hashes are generated based on file content and file location. If your deploy environment has unpredictable file locations (e.g. a date-based folder structure), this produces inconsistent hashes for the same files.

This plugin will produce consistent file hashes, regardless of where the files are located.

Installation

npm install webpack-hash

Usage

This plugin expects to be paired with chunkhash, and it will generate a unique hash per named chunk. It's recommended that you exclude this plugin from your dev environment. Currently, the plugin uses md5 hash, and offers no configuration options.

// webpack.config.js
// Include the hash plugin
var HashPlugin = require('webpack-hash');
 
// ... More webpack stuff here ...
 
// Later, assuming env is a variable holding your build environment
if (env !== 'dev') {
  config.plugins.push(new RevPlugin());
}

License

MIT

Package Sidebar

Install

npm i webpack-hash

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • chrisdavies