webpack-chunk-hash
Plugin to replace a standard webpack chunk hashing with custom (md5) one.
Last updated 7 years ago by alexindigo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install webpack-chunk-hash 
SYNC missed versions from official npm registry.

webpack-chunk-hash

Plugin to replace a standard webpack chunk hashing with custom (md5) one.

Note: It's a clone of webpack-md5-hash plugin, but without sorting provided chunks (unobtrusive), and using native crypto module (performance).

Install

npm install --save-dev webpack-chunk-hash

Example

Just add this plugin as usual.


// webpack.config.js

var WebpackChunkHash = require('webpack-chunk-hash');

module.exports = {
  // ...
  output: {
    filename: '[name].[chunkhash].js',
    chunkFilename: '[name].[chunkhash].js',
  },
  plugins: [
    new WebpackChunkHash({algorithm: 'md5'}) // 'md5' is default value
  ]
};

Options

// a callback to add more content to the resulting hash
additionalHashContent: function(chunk) { return 'your additional content to hash'; } 
// which algorithm to use (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)
algorithm: 'md5'
// which digest to use (https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding)
digest:    'hex'

License

WebpackChunkHash plugin is released under the MIT license.

Current Tags

  • 0.6.0                                ...           latest (7 years ago)

6 Versions

  • 0.6.0                                ...           7 years ago
  • 0.5.0                                ...           7 years ago
  • 0.4.0                                ...           8 years ago
  • 0.3.0                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (5)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE