From 4fb464d20e5c3ece8b68a94f099d032481f46cbe Mon Sep 17 00:00:00 2001 From: mojinming Date: Mon, 12 Dec 2022 11:01:55 +0800 Subject: [PATCH] [fix] Named slots breaks svelte-ignore comments Fixes #8075 --- src/compiler/compile/nodes/InlineComponent.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/compile/nodes/InlineComponent.ts b/src/compiler/compile/nodes/InlineComponent.ts index 26cfeb7ef9..e7508f82fd 100644 --- a/src/compiler/compile/nodes/InlineComponent.ts +++ b/src/compiler/compile/nodes/InlineComponent.ts @@ -143,6 +143,10 @@ export default class InlineComponent extends Node { children.push(slot_template); info.children.splice(i, 1); + } else if (child.type === 'Comment') { + if (children.length > 0) { + children[children.length - 1].children.unshift(child); + } } }