html-better-hash-webpack-plugin

the better hash for html-webpack-plugin


Keywords
hash, html, webpack, html-webpack-plugin
License
MIT
Install
npm install html-better-hash-webpack-plugin@1.0.0

Documentation

HTML better hash Webpack Plugin

the better hash for html-webpack-plugin

Installation

Install the plugin with npm:

$ npm install html-better-hash-webpack-plugin --save-dev

Basic Usage

The plugin will setting better hash for html-webpack-plugin,you must install html-webpack-plugin and add the plugin to your webpack config as follows:

var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlBetterHash = require('html-better-hash-webpack-plugin')
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'index_bundle.js'
  },
  plugins: [
    new HtmlWebpackPlugin({
      hash:true
    }),
    new HtmlBetterHash()
  ]
};

This will generate a file dist/index.html containing the following:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Webpack App</title>
  </head>
  <body>
    <script src="index_bundle.js"></script>
  </body>
</html>