fix(compiler-core): avoid generating useless createVNode helper (#2938)
close #2739
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
import { TransformContext } from '../transform'
|
||||
import { PatchFlags, isString, isSymbol } from '@vue/shared'
|
||||
import { isSlotOutlet } from '../utils'
|
||||
import { CREATE_VNODE } from '../runtimeHelpers'
|
||||
import { CREATE_BLOCK, CREATE_VNODE, OPEN_BLOCK } from '../runtimeHelpers'
|
||||
|
||||
export function hoistStatic(root: RootNode, context: TransformContext) {
|
||||
walk(
|
||||
@@ -212,6 +212,8 @@ export function getConstantType(
|
||||
// static then they don't need to be blocks since there will be no
|
||||
// nested updates.
|
||||
if (codegenNode.isBlock) {
|
||||
context.removeHelper(OPEN_BLOCK)
|
||||
context.removeHelper(CREATE_BLOCK)
|
||||
codegenNode.isBlock = false
|
||||
context.helper(CREATE_VNODE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user