webpack-md5-hash

raw JSON →
0.0.6 verified Sat Apr 25 auth: no javascript maintenance

A webpack plugin that replaces the standard webpack chunkhash with an MD5 hash based on the chunk's module contents. The latest version (0.0.6) was released with a low-release cadence, no recent updates or maintenance. It's a minimal alternative to webpack's built-in chunkhash, offering deterministic MD5 hashing and supporting older webpack versions. Requires Node.js and webpack. Not actively maintained; consider using webpack's own [contenthash] or other modern hashing plugins.

error Cannot find module 'webpack-md5-hash'
cause Package not installed
fix
Run 'npm install webpack-md5-hash --save-dev' to install the package.
error Plugin is not a constructor
cause Incorrect import syntax using ESM import instead of CommonJS require
fix
Use 'var WebpackMd5Hash = require('webpack-md5-hash');' instead of import statement.
error The 'chunkhash' is not being replaced with MD5
cause Output filename does not include [chunkhash] placeholder
fix
Add [chunkhash] to output.filename or output.chunkFilename, e.g., '[name].[chunkhash].js'.
deprecated This plugin is not actively maintained and uses MD5, which is cryptographically broken for security purposes.
fix Use webpack's built-in [contenthash] or a more modern hashing plugin like webpack-hash-webpack-plugin.
gotcha The plugin only works with CommonJS (require); does not support ES module imports.
fix Use require() in CommonJS context; for ESM projects, consider an alternative plugin with ESM support.
breaking Plugin may not be compatible with webpack versions above 4.x; tested only with webpack 1.x.
fix Check compatibility with your webpack version; for webpack 5, use [contenthash] instead.
gotcha Output filenames must include [chunkhash] placeholder for the plugin to have effect.
fix Ensure output.filename or output.chunkFilename contains [chunkhash].
npm install webpack-md5-hash
yarn add webpack-md5-hash
pnpm add webpack-md5-hash

Shows how to add the plugin to a webpack configuration to replace chunkhash with MD5.

// webpack.config.js
var WebpackMd5Hash = require('webpack-md5-hash');
module.exports = {
  entry: './app.js',
  output: {
    path: 'dist',
    filename: '[name].[chunkhash].js',
    chunkFilename: '[chunkhash].[id].chunk.js'
  },
  plugins: [
    new WebpackMd5Hash()
  ]
};