build: reduce runtime build size

This commit is contained in:
Evan You
2021-07-21 11:11:40 -04:00
parent 9d5dd2da8c
commit dd1439e711
3 changed files with 17 additions and 12 deletions

View File

@@ -16,6 +16,8 @@ import { baseCompile } from '@vue/compiler-core'
declare var __VUE_HMR_RUNTIME__: HMRRuntime
const { createRecord, rerender, reload } = __VUE_HMR_RUNTIME__
runtimeTest.registerRuntimeCompiler(compileToFunction)
function compileToFunction(template: string) {
const { code } = baseCompile(template)
const render = new Function('Vue', code)(