Skip to content

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

Open

Description

@JounQin

As title?

Activity

  1. ndbroadbent commented on May 31, 2020

    @ndbroadbent
    Member

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

  2. langarus commented on Sep 11, 2020

    @langarus

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

  3. wanglianjie91 commented on Jun 2, 2021

    @wanglianjie91

    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.

  4. cdllqos commented on Sep 10, 2022

    @cdllqos

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions