diff --git a/packages/compiler-core/src/transforms/transformText.ts b/packages/compiler-core/src/transforms/transformText.ts index 103ceb6f..0c672f9c 100644 --- a/packages/compiler-core/src/transforms/transformText.ts +++ b/packages/compiler-core/src/transforms/transformText.ts @@ -85,7 +85,8 @@ export const transformText: NodeTransform = (node, context) => { getConstantType(child) === ConstantTypes.NOT_CONSTANT ) { callArgs.push( - `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */` + PatchFlags.TEXT + + (__DEV__ ? ` /* ${PatchFlagNames[PatchFlags.TEXT]} */` : ``) ) } children[i] = { diff --git a/packages/compiler-core/src/transforms/vFor.ts b/packages/compiler-core/src/transforms/vFor.ts index 7949c014..aadb07ed 100644 --- a/packages/compiler-core/src/transforms/vFor.ts +++ b/packages/compiler-core/src/transforms/vFor.ts @@ -88,7 +88,8 @@ export const transformFor = createStructuralDirectiveTransform( helper(FRAGMENT), undefined, renderExp, - `${fragmentFlag} /* ${PatchFlagNames[fragmentFlag]} */`, + fragmentFlag + + (__DEV__ ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``), undefined, undefined, true /* isBlock */, @@ -147,9 +148,10 @@ export const transformFor = createStructuralDirectiveTransform( helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, - `${PatchFlags.STABLE_FRAGMENT} /* ${ - PatchFlagNames[PatchFlags.STABLE_FRAGMENT] - } */`, + PatchFlags.STABLE_FRAGMENT + + (__DEV__ + ? ` /* ${PatchFlagNames[PatchFlags.STABLE_FRAGMENT]} */` + : ``), undefined, undefined, true diff --git a/packages/compiler-core/src/transforms/vIf.ts b/packages/compiler-core/src/transforms/vIf.ts index e98604d0..a9ea7acf 100644 --- a/packages/compiler-core/src/transforms/vIf.ts +++ b/packages/compiler-core/src/transforms/vIf.ts @@ -251,9 +251,10 @@ function createChildrenCodegenNode( helper(FRAGMENT), createObjectExpression([keyProperty]), children, - `${PatchFlags.STABLE_FRAGMENT} /* ${ - PatchFlagNames[PatchFlags.STABLE_FRAGMENT] - } */`, + PatchFlags.STABLE_FRAGMENT + + (__DEV__ + ? ` /* ${PatchFlagNames[PatchFlags.STABLE_FRAGMENT]} */` + : ``), undefined, undefined, true,