0.0.1 • Published 8 years ago

webpack-hash v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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