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

support css/auto as css module type #16572

Closed
hardfist opened this issue Dec 15, 2022 · 1 comment · Fixed by #16577
Closed

support css/auto as css module type #16572

hardfist opened this issue Dec 15, 2022 · 1 comment · Fixed by #16577

Comments

@hardfist
Copy link
Contributor

hardfist commented Dec 15, 2022

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

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

Successfully merging a pull request may close this issue.

3 participants