Socket
Socket
Sign inDemoInstall

webpack-chunk-hash

Package Overview
Dependencies
11
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webpack-chunk-hash

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


Version published
Weekly downloads
20K
decreased by-20.74%
Maintainers
3
Install size
1.90 MB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 02 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc