Skip to content

support css/auto as css module type #16572

Description

@hardfist

Feature request

What is the expected behavior?
I want to use webpack css module to handle less-loader result

{
   module: {
    rules: [{
       test: /\.less$/,
       use: ['less-loader'],
       type: 'css/auto'
     }]
   }
}

without css/auto we need to configure two rules

{
   module: {
    rules: [{
       test: /\.module.less$/,
       use: ['less-loader'],
       type: 'css/module'
     },{
       test: /(?<!module).less$/,
       use: ['less-loader'],
       type: 'css/global'
     }]
   }
}

What is motivation or use case for adding/changing the behavior?
simplify the interop of experimental.css with less | sass
How should this be implemented in your opinion?
add a separate css/auto to automatic handle css file like css-loader https://github.com/webpack-contrib/css-loader/blob/ef749f29f8696b93f9eea61e6d00f2bb30ce094c/src/utils.js#L543
Are you willing to work on this yourself?
yes

Activity

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

    help wantedMaintainers welcome a community PR for thiswebpack-5Concerns the webpack 5 line

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions