webpack plugin that parse HTML in search of hashable js chunks"
npm install html-hash-webpack-pluginhtml-hash-webpack-plugin
========================
A webpack plugin that parse HTML in search of hashable js chunks.
The plugin takes the hashed chunks generated by webpack.optimize.CommonsChunkPlugin
and parses the HTML to find those chunks and add the hash to the filename.
```
npm install html-hash-webpack-plugin --save-dev
javascript
var webpack = require('webpack');
var HtmlHashPlugin = require('html-hash-webpack-plugin');module.exports = {
/// ... rest of config
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.[chunkhash].js'),
new HtmlHashPlugin({
origin: 'src/',
output: 'public/',
html_file: 'index.html' // default_
})
]
}
`So, in the origin file, we'll have:
`html
`After running the plugin, we'll get:
`html
``hash numbers are just an example ;-)
MIT License