Socket
Socket
Sign inDemoInstall

html-webpack-hash-version-plugin

Package Overview
Dependencies
372
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    html-webpack-hash-version-plugin

Append hash version for assets in generated html file


Version published
Maintainers
1
Install size
5.71 kB
Created

Readme

Source

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'
  // ...
}

Keywords

FAQs

Last updated on 03 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc