daiwei 1 год назад
Родитель
Сommit
5177f16bc1

+ 5 - 1
packages/server-renderer/src/helpers/ssrCompile.ts

@@ -17,7 +17,11 @@ type SSRRenderFunction = (
   parentInstance: ComponentInternalInstance,
 ) => void
 
-const compileCache: Record<string, SSRRenderFunction> = Object.create(null)
+let compileCache: Record<string, SSRRenderFunction> = Object.create(null)
+
+export function ssrClearCompileCache(): void {
+  compileCache = Object.create(null)
+}
 
 export function ssrCompile(
   template: string,

+ 1 - 0
packages/server-renderer/src/index.ts

@@ -14,6 +14,7 @@ export {
   // deprecated
   renderToStream,
 } from './renderToStream'
+export { ssrClearCompileCache } from './helpers/ssrCompile'
 
 // internal runtime helpers
 export * from './internal'