Skip to content

Commit

Permalink
fix(compiler-core): preserve comment content in production when comme…
Browse files Browse the repository at this point in the history
…nts option is enabled
  • Loading branch information
yyx990803 committed Apr 28, 2021
1 parent 1d1af40 commit e486254
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/compiler-core/src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

This comment has been minimized.

Copy link
@shipMatserJack

shipMatserJack May 9, 2021

nice

if (pure) {
push(PURE_ANNOTATION)
}
push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node)
}

function genVNodeCall(node: VNodeCall, context: CodegenContext) {
Expand Down

0 comments on commit e486254

Please sign in to comment.