-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Hi
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels