1.0.2 • Published 4 years ago

webpack-hash-file-plugin v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

About

This plugins emits a file named [assetName].hash containing assets hash.

Currently it looks for the query parameter v in the asset name.

Usage

yarn add -D webpack-hash-file-plugin

const WebpackHashFilePlugin = require('webpack-hash-file-plugin');

module.exports {
    output: {
        filename: '[name].js?v=[hash]',
        chunkFilename: '[id].js?v=[contenthash]',
    },
    plugins: [
        new WebpackHashFilePlugin()
    ]
}

Example output files:

  • myEntry.js
  • myEntry.js.hash
  • otherEntry.js
  • otherEntry.js.hash
  • otherEntry.css
  • otherEntry.css.hash

Options

NameDescriptionDefault
paramNameParameter containing tha hashv
hashFileExtensionExtension of the generated hash filehash
extractHashFromAssetName(assetName, options)Function to extract the hash from asset name-
1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago