You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using antd as a UI toolkit. I want to implement style modules in my project. I tried like this
`modifyLessRule(lessRule, context) {
// You have to exclude these file suffixes first,
// if you want to modify the less module's suffix
// const relativePath = path.relative(context, resourcePath);
console.log(context)
lessRule.exclude = /\.less$/;
return lessRule;
},
modifyLessModuleRule(lessModuleRule, context) {
// Configure the file suffix
lessModuleRule.test = /\.less$/;
// Configure the generated local ident name.
const cssLoader = lessModuleRule.use.find(loaderByName("css-loader"));
cssLoader.options.modules = {
localIdentName: "[local]_[hash:base64:5]",
};
return lessModuleRule;
},`
But it applied to all less files including antd library. I want to apply only for styles inside the src folder. I know we can do by renaming all style files inside the src folder with some suffix (index.m.less) and change the regex.
I want to keep my style file as formatted now (index.less). Is there any option to apply modify rule only for my src folder?
The text was updated successfully, but these errors were encountered:
Hi
I am using antd as a UI toolkit. I want to implement style modules in my project. I tried like this
But it applied to all less files including antd library. I want to apply only for styles inside the src folder. I know we can do by renaming all style files inside the src folder with some suffix (index.m.less) and change the regex.
I want to keep my style file as formatted now (index.less). Is there any option to apply modify rule only for my src folder?
The text was updated successfully, but these errors were encountered: