{"id":20718,"library":"webpack-chunk-hash","title":"webpack-chunk-hash","description":"Webpack plugin that replaces standard chunk hashing with a custom MD5 hash, without sorting chunks (unobtrusive) and using Node's native crypto module for performance. Current stable version is 0.6.0, which supports Webpack 4 while maintaining backward compatibility with Webpack 3. It is a clone of webpack-md5-hash but avoids chunk sorting and uses native crypto. The plugin offers options for algorithm, digest, and additional hash content. Release cadence is low; the plugin is stable but not actively developed.","status":"maintenance","version":"0.6.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/alexindigo/webpack-chunk-hash","tags":["javascript","webpack","hash","plugin","md5"],"install":[{"cmd":"npm install webpack-chunk-hash","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-chunk-hash","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-chunk-hash","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only and does not provide an ESM export. Use require() or use a default import with a bundler that handles CJS interop.","wrong":"import WebpackChunkHash from 'webpack-chunk-hash';","symbol":"WebpackChunkHash","correct":"const WebpackChunkHash = require('webpack-chunk-hash');"},{"note":"With bundlers like Webpack or esbuild that support CJS interop, a default import works. However, the package exports via module.exports, so named imports will fail.","wrong":null,"symbol":"WebpackChunkHash","correct":"import WebpackChunkHash from 'webpack-chunk-hash';"},{"note":"The plugin is a constructor. Do not try to access a property on it; just instantiate directly.","wrong":"new WebpackChunkHash.WebpackChunkHash({ algorithm: 'md5' })","symbol":"WebpackChunkHash","correct":"new WebpackChunkHash({ algorithm: 'md5' })"}],"quickstart":{"code":"// webpack.config.js\nconst WebpackChunkHash = require('webpack-chunk-hash');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    filename: '[name].[chunkhash].js',\n    chunkFilename: '[name].[chunkhash].js',\n  },\n  plugins: [\n    new WebpackChunkHash({ algorithm: 'md5', digest: 'hex' })\n  ]\n};","lang":"javascript","description":"Replaces Webpack's default chunk hashing with MD5 using the plugin. Configures output filenames with [chunkhash] and applies the plugin."},"warnings":[{"fix":"Consider removing the plugin and relying on Webpack 4's built-in hashing or upgrading to Webpack 5 which uses content hash.","message":"Webpack 4 integrated improved hashing natively; this plugin may be unnecessary.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Use [contenthash] instead of [chunkhash] and replace this plugin with Webpack 5's built-in deterministic hashing.","message":"Webpack 5 dropped support for [chunkhash] in favor of [contenthash]; this plugin may not work with Webpack 5.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Ensure chunk order is deterministic or use a plugin that sorts chunks (e.g., webpack-md5-hash).","message":"The plugin does not sort chunks before hashing; this can lead to inconsistent hashes across builds if chunk order varies.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use require() or configure your bundler for CJS interop.","message":"Only CommonJS require is supported; ESM imports may fail if the bundler does not handle CJS interop.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use default import: const WebpackChunkHash = require('webpack-chunk-hash');","cause":"Using a named import (import { WebpackChunkHash }) when the package exports via module.exports.","error":"TypeError: WebpackChunkHash is not a constructor"},{"fix":"Run: npm install --save-dev webpack-chunk-hash","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'webpack-chunk-hash'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}