webpack-replace-chunkhash-contenthash
replace webpack output js files chunkhash with the final conent md5.
Installation
With npm
npm install webpack-replace-chunkhash-contenthash --save-dev
With yarn
yarn add webpack-replace-chunkhash-contenthash --dev
Usage
Just add this plugin as usual.
// webpack.config.jsconst ContentHash = ; moduleexports = // ... output: //... filename: '[name].[chunkhash].js' plugins: options ;
Options
options.manifestFiles
type: Array[string] , default to [].
if you are generating a common chunk, it needs to be here.
Examples
const path = ;const webpack = ;const HtmlWebpackPlugin = ;const ContentHash = ;moduleexports = entry: w: './w.js' v: './v.js' output: path: path filename: '[name].[chunkhash:12].js' chunkFilename: '[name].[chunkhash:12].js' module: {} plugins: name: "zentry"//entry chunks: 'v' name: "jquery"//jquery chunks: 'v' /jquery/ name: "thirdparty"//thirdparty chunks: 'v' /node_modules/ filename: 'index.html' template: './index.html' chunksSortMode: 'manual' chunks: 'w' 'zentry' 'jquery' 'thirdparty' 'v' manifestFiles: 'zentry' chunkHashLength: 12 ;
options.chunkHashLength
type: number , default to empty.
the final js file chunkhash length.
contributors
sweetyx[https://github.com/z827101859]