Skip to content

leovo2708/html-webpack-hash-version-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hash Version extension for HTML Webpack Plugin

Another solution to solve caching problem by append hash version on each assets:

/assets/main.js => /assets/main.js?v={hash}

Installation

You must be running webpack on node 0.12.x or higher

Install the plugin with npm:

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

Basic Usage

Require the plugin in your webpack config:

var HtmlWebpackHashVersionPlugin = require('html-webpack-hash-version-plugin');

Add the plugin to your webpack config as follows:

plugins: [
  new HtmlWebpackPlugin(),
  new HtmlWebpackHashVersionPlugin()
]  

You should configure fileName & chunkFilename for assets with no hash because this plugin will do this for us

{
  // ...
  filename: 'static/js/[name].js',
  chunkFilename: 'static/js/[name].chunk.js'
  // ...
}

About

Append hash version for assets in generated html file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published