Closed
Description
Version
Tested with 16.8.0, 16.1.2, and 15.9.8
Reproduction link
https://github.com/nskazki/vue-loader-and-webpack-layers
Steps to reproduce
- cd into the cloned repo, run
npm run build
, get an error - checkout to
040fe39
where Vue Plugin isn't being used, runnpm run build
, get a compiled bundle
What is expected?
Vue Loader isn't preventing one from using experimental features in general and layers in particular.
What is actually happening?
Can't use layers in the project utilizing Vue Loader due to
[webpack-cli] Error: Compiling RuleSet failed: Properties issuerLayer are unknown (at ruleSet[0]: [object Object])
at RuleSetCompiler.error (/Volumes/Repos/vue-loader-and-webpack-layers/node_modules/webpack/lib/rules/RuleSetCompiler.js:373:10)
at RuleSetCompiler.compileRule (/Volumes/Repos/vue-loader-and-webpack-layers/node_modules/webpack/lib/rules/RuleSetCompiler.js:196:15)
at /Volumes/Repos/vue-loader-and-webpack-layers/node_modules/webpack/lib/rules/RuleSetCompiler.js:154:9
at Array.map (<anonymous>)
at RuleSetCompiler.compileRules (/Volumes/Repos/vue-loader-and-webpack-layers/node_modules/webpack/lib/rules/RuleSetCompiler.js:153:16)
at RuleSetCompiler.compile (/Volumes/Repos/vue-loader-and-webpack-layers/node_modules/webpack/lib/rules/RuleSetCompiler.js:68:22)
at match (/Volumes/Repos/vue-loader-and-webpack-layers/node_modules/vue-loader/dist/pluginWebpack5.js:156:35)
at VueLoaderPlugin.apply (/Volumes/Repos/vue-loader-and-webpack-layers/node_modules/vue-loader/dist/pluginWebpack5.js:61:24)
at createCompiler (/Volumes/Repos/vue-loader-and-webpack-layers/node_modules/webpack/lib/webpack.js:73:12)
at /Volumes/Repos/vue-loader-and-webpack-layers/node_modules/webpack/lib/webpack.js:44:48
About Layers
- It's an experimental feature: https://webpack.js.org/configuration/experiments/#experiments
- There isn't much documentation to it: add experiments.layers webpack/webpack#12327, https://webpack.js.org/configuration/module/#rulelayer, https://webpack.js.org/configuration/module/#ruleissuerlayer and https://webpack.js.org/configuration/entry-context/#entry-descriptor
- However, the feature lets you process the same CSS differently when it's imported by a certain entry point or file, which cannot be accomplished in any other way.
Special Request
I would really appreciate it if you backport the fix to vue-loader@15
because I can't upgrade to Vue@3 just yet but I'll understand if you don't.
Metadata
Metadata
Assignees
Labels
No labels