Skip to content

Commit

Permalink
fix: icss mode not work for less global
Browse files Browse the repository at this point in the history
  • Loading branch information
dr2009 committed Dec 21, 2021
1 parent a2bc044 commit 68e04dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/craco-less.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ const overrideWebpackConfig = ({ context, webpackConfig, pluginOptions }) => {
},
});
} else if (rule.loader.includes(`${pathSep}css-loader${pathSep}`)) {
const isModule = overrideRule.test === lessModuleRegex;
lessRule.use.push({
loader: rule.loader,
options: {
...rule.options,
...(pluginOptions.cssLoaderOptions || {}),
...(isModule ? {} : { modules: { mode: "global" } }),
},
});
} else if (rule.loader.includes(`${pathSep}postcss-loader${pathSep}`)) {
Expand Down

0 comments on commit 68e04dc

Please sign in to comment.