From e4862544310a4187dfc8b3a49944700888bb60e3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 28 Apr 2021 11:22:16 -0400 Subject: [PATCH] fix(compiler-core): preserve comment content in production when comments option is enabled --- packages/compiler-core/src/codegen.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/compiler-core/src/codegen.ts b/packages/compiler-core/src/codegen.ts index cfe345f6..d2322f41 100644 --- a/packages/compiler-core/src/codegen.ts +++ b/packages/compiler-core/src/codegen.ts @@ -738,13 +738,11 @@ function genExpressionAsPropertyKey( } function genComment(node: CommentNode, context: CodegenContext) { - if (__DEV__) { - const { push, helper, pure } = context - if (pure) { - push(PURE_ANNOTATION) - } - push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node) + const { push, helper, pure } = context + if (pure) { + push(PURE_ANNOTATION) } + push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node) } function genVNodeCall(node: VNodeCall, context: CodegenContext) {