Plugin to replace a standard webpack chunkhash with SHA
npm install webpack-sha-hash bash
npm install webpack-sha-hash --save-dev
`
Usage
Like most plugins, you just need to import it and add it to your plugins array:
` javascript
const WebpackSHAHash = require('webpack-sha-hash');
module.exports = {
// ...
output: {
//...
chunkFilename: "[chunkhash].[id].chunk.js"
},
plugins: [
new WebpackSHAHash()
]
};
`
Enjoy!
Options
$3
The SHA-256 hashing algorithm is used by default. If you want, you can use any of the supported algorithms supported by sha.js: https://www.npmjs.com/package/sha.js
To override the algorithm, just provide the name of the one you want to use to the plugin:
` javascript
...
plugins: [
new WebpackSHAHash({
hashingAlgorithm: "sha512"
})
]
`
Contributing
Take a look at the project's open issues and milestones.
If you know what to do then:
* Fork the project
* Create a feature branch in your fork
* Rebase if needed to keep the project history clean
* Commit your changes & push to GitHub
* Try and flood me with pull requests :)
Building from source
` bash
npm run setup
npm
``