A Webpack plugin that replaces chunkhash placeholders with an MD5 hash of the final file content, computed after all other plugins (like UglifyJsPlugin) have run. v3.2.1 requires Webpack >=4. Unlike other hash plugins that compute hashes earlier, this plugin ensures that any change in the build pipeline—including minification configuration—is reflected in the output hash, preventing cache conflicts. It supports sourcemaps partially and has known ordering requirements with plugins like HtmlWebpackPlugin. Maintained on GitHub, low release cadence (last release 2020).
npm install webpack-plugin-hash-outputVerified import paths — ran on the pinned version, not inferred.
Configures webpack to replace chunkhash with content-based MD5 hash, placed before HtmlWebpackPlugin.
Place new HashOutput() before any plugin that uses asset filenames, e.g., HtmlWebpackPlugin.
Avoid using devtool sourcemaps with this plugin if correct sourcemap filenames are critical.
Upgrade to webpack >=4 or stay on v2 (which supports webpack 3).
Remove { validateOutput: true } from options; the validation is now always on.Set output.filename to include [chunkhash] (e.g., '[name].[chunkhash].js').
Run npm install webpack-plugin-hash-output --save-dev and ensure the path is correct in the webpack config.
Use const HashOutput = require('webpack-plugin-hash-output'); (no destructuring).Check that options are valid: currently only optional 'validateOutput' (deprecated) exists.
Move new HashOutput() to the top of the plugins array.