Skip to content
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

How can I change .module.less to .m.less? #39

Open
JounQin opened this issue May 6, 2020 · 4 comments
Open

How can I change .module.less to .m.less? #39

JounQin opened this issue May 6, 2020 · 4 comments

Comments

@JounQin
Copy link

JounQin commented May 6, 2020

As title?

@ndbroadbent
Copy link
Member

Hello, sorry I don't know. If you find the answer, it would be great to add some information to the README. Thanks!

@langarus
Copy link

I think this is achievable by using by tweaking the css-loader options{modules: { auto: desiredRegEx}}
This is the link for the exact documentation

@wanglianjie91
Copy link

I think this is achievable by using by tweaking the css-loader options{modules: { auto: desiredRegEx}}
This is the link for the exact documentation

it is not work.

@cdllqos
Copy link

cdllqos commented Sep 10, 2022

@JounQin
change lessRule and lessModuleRule should work,like this:

// craco.config.ts
const CracoLessPlugin = require('craco-less');

module.exports = {
  plugins: [
    {
      plugin: CracoLessPlugin,
      options: {
        modifyLessRule(lessRule: any) {
          lessRule.exclude = /\.m\.less$/;
          return lessRule;
        },
        modifyLessModuleRule(lessRule: any) {
          lessRule.test = /\.m\.less$/;
          return lessRule;
        },
      },
    },
  ],
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants