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 pluginvar HashPlugin = ; // ... More webpack stuff here ... // Later, assuming env is a variable holding your build environmentif env !== 'dev' configplugins;
License
MIT