Skip to content

Commit

Permalink
fix(@kkt/stylus-modules): fix rules options errors #198.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 27, 2021
1 parent 549f6fc commit 437c48e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/less-modules/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const createLessModule = (lessLoaderOptions = {} as LessLoaderOptions) => {
modules: {
mode: 'local',
// @ts-ignore
//💥🔥🚨🚸🚫⛔️🔄 Upgrade `@types/react-dev-utils`
getLocalIdent: getCSSModuleLocalIdent,
},
},
Expand Down
10 changes: 1 addition & 9 deletions packages/stylus-modules/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,7 @@ const createLessModule = (stylusLoaderOptions = {} as StylusLoaderOptions) => {
// Exclude all less files (including module files) from file-loader
conf.module.rules = conf.module.rules.map((rule) => {
if (typeof rule === 'object' && rule.oneOf) {
rule.oneOf = rule.oneOf.map((item) => {
if (typeof item.loader === 'string' && /(file-loader)/.test(item.loader)) {
if (Array.isArray(item.exclude)) {
item.exclude.push(sassRegex);
}
}
return item;
});
rule.oneOf = loaders.concat(rule.oneOf);
loaders.forEach((item) => rule.oneOf.splice(rule.oneOf.length - 1, 0, item));
}
return rule;
});
Expand Down

0 comments on commit 437c48e

Please sign in to comment.