Inline Hash Webpack Plugin
Automatically replace the html link and script tags, add hash
Getting Started
Installation
$ npm i webpack-html-hash-plugin
Basic Usage
Step1:
// add hashoutput: filename: '[name].js?v=[hash:6]' // or [name].[hash].js chunkFilename: '[id].js?v=[hash:6]' // or id].[hash:6].js
Step2:
// webpack.config.prod.js ;//...plugins: fileName: 'test.html' template: 'template/test.html' encoding: 'GBK'
or
moduleexports = entry: // ... output: // ... htmlHashOption: fileName: 'test.html' template: 'template/test.html' encoding: 'GBK'
template
is requisite, template pathfileName
is not requisite, defaultindex.html
encoding
is not requisite, defaultutf-8
webpack version < 2.0 , use
new WebpackHtmlHashPlugin.default()
template
Demo
build:
Demo