We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Pass the resourceQuery as a second argument to the modules.auto function callback.
resourceQuery
modules.auto
type auto = boolean | regExp | ((resourcePath: string, resourceQuery: string) => boolean);
You should be able to return true or false based on the resource query. Specially with the vue-loader style module
You only have access to the resource path which doesn't include any information about if the module attribute is set in the style block or not.
The current workaround is to use conditional rules like shown here https://vue-loader.vuejs.org/guide/css-modules.html#opt-in-usage
But this solution is not optimal when there are multiple loaders applied to both CSS and Sass assets.
npx webpack-cli info
System: OS: Windows 10 10.0.19045 CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz Memory: 17.48 GB / 31.91 GB Binaries: Node: 20.10.0 - ~\scoop\apps\nodejs-lts\current\node.EXE Yarn: 1.22.19 - ~\scoop\apps\yarn\current\bin\yarn.CMD npm: 10.2.5 - ~\scoop\apps\nodejs-lts\current\bin\npm.CMD Browsers: Edge: Chromium (120.0.2210.144) Internet Explorer: 11.0.19041.3636 Packages: copy-webpack-plugin: ^12.0.2 => 12.0.2 css-loader: ^6.9.1 => 6.9.1 postcss-loader: ^8.0.0 => 8.0.0 sass-loader: ^14.0.0 => 14.0.0 style-loader: ^3.3.4 => 3.3.4 svgo-loader: ^4.0.0 => 4.0.0 swc-minify-webpack-plugin: ^2.1.1 => 2.1.1 vue-loader: ^17.4.2 => 17.4.2 webpack: ^5.89.0 => 5.89.0 webpack-bundle-analyzer: ^4.10.1 => 4.10.1 webpack-cli: ^5.1.4 => 5.1.4 webpack-dev-server: ^4.15.1 => 4.15.1 webpack-manifest-plugin: ^5.0.0 => 5.0.0
The text was updated successfully, but these errors were encountered:
Based on my quick research, this should be easy to add in here:
css-loader/src/utils.js
Lines 647 to 648 in f9192ee
Sorry, something went wrong.
Feel free to send a PR
resourceFragment
auto
Successfully merging a pull request may close this issue.
Modification Proposal
Pass the
resourceQuery
as a second argument to themodules.auto
function callback.Expected Behavior / Situation
You should be able to return true or false based on the resource query. Specially with the vue-loader style module
Actual Behavior / Situation
You only have access to the resource path which doesn't include any information about if the module attribute is set in the style block or not.
The current workaround is to use conditional rules like shown here https://vue-loader.vuejs.org/guide/css-modules.html#opt-in-usage
But this solution is not optimal when there are multiple loaders applied to both CSS and Sass assets.
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: