]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-core): preserve comment content in production when comments option is...
authorEvan You <yyx990803@gmail.com>
Wed, 28 Apr 2021 15:22:16 +0000 (11:22 -0400)
committerEvan You <yyx990803@gmail.com>
Wed, 28 Apr 2021 15:22:16 +0000 (11:22 -0400)
packages/compiler-core/src/codegen.ts

index cfe345f62a207f9f347a3235c15969585cc77da6..d2322f4180cb9fa92edade4d5714afcfe57e6ae8 100644 (file)
@@ -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) {