Skip to content

Commit b3b65b4

Browse files
committed
fix: runtime compilation marker should be applied in exposed compile function
1 parent a5e55e2 commit b3b65b4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/runtime-core/src/component.ts

-2
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,6 @@ function finishComponentSetup(
601601
if (__DEV__) {
602602
endMeasure(instance, `compile`)
603603
}
604-
// mark the function as runtime compiled
605-
;(Component.render as InternalRenderFunction)._rc = true
606604
}
607605

608606
instance.render = (Component.render || NOOP) as InternalRenderFunction

packages/vue/src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { compile, CompilerOptions, CompilerError } from '@vue/compiler-dom'
55
import { registerRuntimeCompiler, RenderFunction, warn } from '@vue/runtime-dom'
66
import * as runtimeDom from '@vue/runtime-dom'
77
import { isString, NOOP, generateCodeFrame, extend } from '@vue/shared'
8+
import { InternalRenderFunction } from 'packages/runtime-core/src/component'
89

910
__DEV__ && initDev()
1011

@@ -74,6 +75,10 @@ function compileToFunction(
7475
const render = (__GLOBAL__
7576
? new Function(code)()
7677
: new Function('Vue', code)(runtimeDom)) as RenderFunction
78+
79+
// mark the function as runtime compiled
80+
;(render as InternalRenderFunction)._rc = true
81+
7782
return (compileCache[key] = render)
7883
}
7984

0 commit comments

Comments
 (0)