Code Monkey home page Code Monkey logo

webpack-sha-hash's Introduction

webpack-sha-hash

NPM version Downloads Build Status Dependency Status devDependency Status License

About

Using this Webpack plugin, you can easily generate SHA hashes for your Webpack chunks. This plugin replaces the standard chunkhash of Webpack with SHA.

This project is a fork of https://github.com/erm0l0v/webpack-md5-hash based on SHA instead of MD5. Why? Because MD5 is a thing of the past, so why continue to use it? :)

SHA hashes are created using sha.js

Status & roadmap

Check out the issues/labels and milestones to get an idea of what's next. For existing features, refer to the previous sections.

Check out the change log

Installation

npm install webpack-sha-hash --save-dev

Usage

Like most plugins, you just need to import it and add it to your plugins array:

const WebpackSHAHash = require('webpack-sha-hash');

module.exports = {
    // ...
    output: {
        //...
        chunkFilename: "[chunkhash].[id].chunk.js"
    },
    plugins: [
        new WebpackSHAHash()
    ]
};

Enjoy!

Options

hashingAlgorithm: use a different hashing algorithm

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:

...
    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

npm run setup
npm

Releasing a version

  • commit all changes to include in the release
  • edit the version in package.json
    • respect semver
  • update CHANGELOG.MD
  • commit
  • git tag
  • git push --tags
  • draft the release on GitHub (add description, link to current changelot, etc)
  • npm publish

Authors

Sebastien Dubois

License

This project and all associated source code is licensed under the terms of the MIT License.

Jetbrains love

We're supported by Jetbrains and their awesome support for open source, thanks to which we are able to use the best products on the market to work on this open source project!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.