Open nskazki opened 3 years ago
This patch does it for me:
patches/vue-loader+15.9.6.patch
diff --git a/node_modules/vue-loader/lib/plugin-webpack5.js b/node_modules/vue-loader/lib/plugin-webpack5.js
index 9b156ff..3f1cdbc 100644
--- a/node_modules/vue-loader/lib/plugin-webpack5.js
+++ b/node_modules/vue-loader/lib/plugin-webpack5.js
@@ -20,12 +20,14 @@ const ruleSetCompiler = new RuleSetCompiler([
new BasicMatcherRulePlugin('realResource'),
new BasicMatcherRulePlugin('issuer'),
new BasicMatcherRulePlugin('compiler'),
+ new BasicMatcherRulePlugin("issuerLayer"),
new DescriptionDataMatcherRulePlugin(),
new BasicEffectRulePlugin('type'),
new BasicEffectRulePlugin('sideEffects'),
new BasicEffectRulePlugin('parser'),
new BasicEffectRulePlugin('resolve'),
new BasicEffectRulePlugin('generator'),
+ new BasicEffectRulePlugin("layer"),
new UseEffectRulePlugin()
])
generated with https://www.npmjs.com/package/patch-package
Actually, component.vue?type=style
doesn't inherit the layer, so that patch doesn't fix the problem.
[webpack-cli] Error: Compiling RuleSet failed: Properties issuerLayer are unknown (at clonedRuleSet-2.oneOf[0]: [object Object])
at RuleSetCompiler.error (node_modules\webpack\lib\rules\RuleSetCompiler.js:373:10)
at RuleSetCompiler.compileRule (node_modules\webpack\lib\rules\RuleSetCompiler.js:196:15)
at node_modules\webpack\lib\rules\RuleSetCompiler.js:154:9
at Array.map (<anonymous>)
at RuleSetCompiler.compileRules (node_modules\webpack\lib\rules\RuleSetCompiler.js:153:16)
at RuleSetCompiler.compileRule (node_modules\webpack\lib\rules\RuleSetCompiler.js:192:30)
at cloneRule (node_modules\vue-loader\dist\pluginWebpack5.js:173:42)
at node_modules\vue-loader\dist\pluginWebpack5.js:101:31
at Array.map (<anonymous>)
at VueLoaderPlugin.apply (node_modules\vue-loader\dist\pluginWebpack5.js:101:14)
vue-loader v17.0.0 was released but this still not fixed, is there something new please @yyx990803 ? Webpack layer is great feature which improves build time for more flavor/variants.
UPDATE: created reproducible repo https://github.com/nolimitdev/vue-loader-webpack-layer-error
Tested against 16.8.0, the problem is still present.
Did we get any solution for this issue ?
INFO Starting development server...
ERROR Error: Compiling RuleSet failed: Unexpected property test in condition (at ruleSet[0].rules[0].resource.test: resource => {
currentResource = resource
return true
})
Error: Compiling RuleSet failed: Unexpected property test in condition (at ruleSet[0].rules[0].resource.test: resource => {
currentResource = resource
return true
})
at RuleSetCompiler.error (/Users/sirajuddeeng/Siraj-DevSpace/GHL-CRM/spm-ts/node_modules/webpack/lib/rules/RuleSetCompiler.js:373:10)
at RuleSetCompiler.compileCondition (/Users/sirajuddeeng/Siraj-DevSpace/GHL-CRM/spm-ts/node_modules/webpack/lib/rules/RuleSetCompiler.js:309:17)
at /Users/sirajuddeeng/Siraj-DevSpace/GHL-CRM/spm-ts/node_modules/webpack/lib/rules/BasicMatcherRulePlugin.js:29:40
at Hook.eval [as call] (eval at create (/Users/sirajuddeeng/Siraj-DevSpace/GHL-CRM/spm-ts/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:19:1)
I have created PR https://github.com/vuejs/vue-loader/pull/2000
@nskazki patch works for me and successfully fixes following demo for webpack layers error in vue-loader https://github.com/nolimitdev/vue-loader-webpack-layer-error
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
npm run build
, get an error040fe39
where Vue Plugin isn't being used, runnpm run build
, get a compiled bundleWhat 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
About Layers
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.