From: Evan You Date: Wed, 28 Apr 2021 15:22:16 +0000 (-0400) Subject: fix(compiler-core): preserve comment content in production when comments option is... X-Git-Tag: v3.1.0-beta.1~59^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4862544310a4187dfc8b3a49944700888bb60e3;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-core): preserve comment content in production when comments option is enabled --- diff --git a/packages/compiler-core/src/codegen.ts b/packages/compiler-core/src/codegen.ts index cfe345f62a..d2322f4180 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) {