From 477912ce383b89dfba632dc5d8364fb2db9e7e0d Mon Sep 17 00:00:00 2001 From: nolimitdev Date: Wed, 19 Apr 2023 11:07:32 +0200 Subject: [PATCH] fix: do not throw when `Rule.layer` (#2000) Related to #1849 but this PR doesn't fix the problem that `component.vue?type=style` doesn't inherit the layer. It only ensures that webpack does not throw, and all existing usages aren't broken by `vue-loader`. --- src/pluginWebpack5.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pluginWebpack5.ts b/src/pluginWebpack5.ts index 3d77883d..3e5abd0f 100644 --- a/src/pluginWebpack5.ts +++ b/src/pluginWebpack5.ts @@ -90,12 +90,14 @@ const ruleSetCompiler = new RuleSetCompiler([ new BasicMatcherRulePlugin('realResource'), new BasicMatcherRulePlugin('issuer'), new BasicMatcherRulePlugin('compiler'), + new BasicMatcherRulePlugin('issuerLayer'), ...objectMatcherRulePlugins, new BasicEffectRulePlugin('type'), new BasicEffectRulePlugin('sideEffects'), new BasicEffectRulePlugin('parser'), new BasicEffectRulePlugin('resolve'), new BasicEffectRulePlugin('generator'), + new BasicEffectRulePlugin('layer'), new UseEffectRulePlugin(), ])