contenthash-html-webpack-plugin
v1.0.2
Published
Makes [contenthash] available for html-webpack-plugin
Downloads
309
Maintainers
Readme
contenthash-html-webpack-plugin
Makes [contenthash]
available for html-webpack-plugin
Install
$ npm install contenthash-html-webpack-plugin --save-dev
Usage
import ContentHashHtmlPlugin from 'contenthash-html-webpack-plugin'
import HtmlPlugin from 'html-webpack-plugin'
const webpackConfig = {
...,
plugins: [
new HtmlPlugin({
filename: `[file]-[contenthash:16].html`,
...
}),
new ContentHashHtmlPlugin()
]
}
// Then the file hash will be the hash of the file content
Available Placeholder Format
'[contenthash]'
'[contenthash:7]' // maxLength: 7
'[md5:contenthash:hex]' // hashType: md5, digestType: hex
'[md5:contenthash:hex:7]'
// hashType: md5
// digestType: hex
// maxLength: 7
License
MIT