Package Exports
- css-loader-name-generator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (css-loader-name-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Css Loader Name Generator
Description
Generator of short names of css classes for css-loader.
Installation
npm install css-loader-name-generator --save-devUsage
// In webpack config file
const CssLoaderNameGenerator = require('css-loader-name-generator');
// For example: 1 - minimal css class name length, 3 - maximal css class name length
const NameGenerator = new CssLoaderNameGenerator(1, 3);
// In css-loader section
{
loader: 'css-loader',
options: {
modules: {
getLocalIdent: NameGenerator.getLocalIdent,
mode: 'local'
}
}
}Example code output
Additional
Also you can use generator out of css-loader context.
const shortName = NameGenerator.getRandomName('my_module_name');