ignatiqq / optimized-css-hash

Optimized css-loader hash for classnames based on the resoursePath

Repository from Github https://github.comignatiqq/optimized-css-hashRepository from Github https://github.comignatiqq/optimized-css-hash

optimized-css-hash

Usage

You can use it like a getLocalIdent option in the 'css-loader'.

const {createGenerator} = require('optimized-css-hash');

{
            loader: 'css-loader',
            options: {
                modules: {
                    // pathHash is the required name to place the optimized hash in the class name.
                    localIdentName: '[name]__[local]___[pathHash]',
                    mode: 'global',
                    getLocalIdent: createGenerator(),
                },
            },
        },

article idea - https://dev.to/denisx/reduce-bundle-size-via-one-letter-css-classname-hash-strategy-10g6

About

Optimized css-loader hash for classnames based on the resoursePath


Languages

Language:JavaScript 100.0%