rollup-plugin-postcss
rollup-plugin-postcss copied to clipboard
Support customizing scoped module in postcss-loader
Currently, in postcss-loader https://github.com/egoist/rollup-plugin-postcss/blob/master/src/postcss-loader.js#L85, the plugin generate the scoped name as [name]_[local]__[hash:base64:5], could we support a feature to customize this?
You can pass a custom scope name callback by specifying generateScopedName option in the modules option. See https://github.com/css-modules/postcss-modules for details of supported options.
For example:
postcss({
modules: {
generateScopedName: (cssname, filepath) => somelogic(cssname, filepath);
}
})
@kendrickw Thanks for the reply. IMO would be super helpful to include an explicit example on the docs
apparently this no longer works in 4.0.2. i am floored at how unbelievably difficult it is to override this basic option.