-
Notifications
You must be signed in to change notification settings - Fork 16
Support for getLocalIdent #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @mvrlin , if the default if you want to generate the classname with your own rules without going through the default I checked what
I could provide the same type of info with additional data if necessary function getlocalIndent(
context: {
context,
resourcePath,
},
// instead of the rule string only
localIndentName: {
rule, // the rule string
generated, // the generated classname which you could hook into
},
localName, // the css className string
options: {
markup, // the markup content
styles, // the styles content
},
) {} something like this would be then possible ...
use: [
{
loader: 'svelte-loader',
options: {
preprocess: [
cssModules({
localIndentName: '[hash:base64:10]',
getLocalIndent: (context, localIndentName, localName, options) => {
return localIndentName.generated.toLowerCase();
}
}),
]
}
}
]
... what do you think? |
@micantoine I want to generate very short class names like |
@mvrlin Check the linked pull request, I have renamed some parameters that I think would make more sense. |
@micantoine Looking good! What do you think about TypeScript typings? |
@mvrlin I do like Typescript, could be nice to develop the preprocess with it. At the time of making it, it was just a small js file I used on my personal projects which I thought could benefit others encountering the same issue with the native scoped system. |
Hello! I really enjoy using your preprocess, but I need a way to generate custom class names, that are not based on the default localIdentName. Webpack
css-loader
has agetLocalIdent
function option for that.The text was updated successfully, but these errors were encountered: