@@ -17,7 +17,7 @@ import { renderPreloadLinks } from './preload-links'
1717
1818export type Manifest = Record < string , string [ ] >
1919
20- export type CreateAppFactory = ( client : boolean , routePath ?: string ) => Promise < ViteReactSSGContext < true > | ViteReactSSGContext < false > >
20+ export type CreateRootFactory = ( client : boolean , routePath ?: string ) => Promise < ViteReactSSGContext < true > | ViteReactSSGContext < false > >
2121
2222function DefaultIncludedRoutes ( paths : string [ ] , _routes : Readonly < RouteRecord [ ] > ) {
2323 // ignore dynamic routes
@@ -104,11 +104,11 @@ export async function build(ssgOptions: Partial<ViteReactSSGOptions> = {}, viteC
104104
105105 const _require = createRequire ( import . meta. url )
106106
107- const { createApp , includedRoutes : serverEntryIncludedRoutes } : { createApp : CreateAppFactory ; includedRoutes : ViteReactSSGOptions [ 'includedRoutes' ] } = format === 'esm'
107+ const { createRoot , includedRoutes : serverEntryIncludedRoutes } : { createRoot : CreateRootFactory ; includedRoutes : ViteReactSSGOptions [ 'includedRoutes' ] } = format === 'esm'
108108 ? await import ( serverEntry )
109109 : _require ( serverEntry )
110110 const includedRoutes = serverEntryIncludedRoutes || configIncludedRoutes
111- const { routes } = await createApp ( false )
111+ const { routes } = await createRoot ( false )
112112
113113 let routesPaths = includeAllRoutes
114114 ? routesToPaths ( routes )
@@ -132,7 +132,7 @@ export async function build(ssgOptions: Partial<ViteReactSSGOptions> = {}, viteC
132132 console . log ( '🚀 ~ file: build.ts:132 ~ build ~ routesPaths:' , routesPaths )
133133 queue . add ( async ( ) => {
134134 try {
135- const appCtx = await createApp ( false , route ) as ViteReactSSGContext < true >
135+ const appCtx = await createRoot ( false , route ) as ViteReactSSGContext < true >
136136 const { app : innerApp , routes, initialState, triggerOnSSRAppRendered, transformState = serializeState } = appCtx
137137
138138 const transformedIndexHTML = ( await onBeforePageRender ?.( route , indexHTML , appCtx ) )
0 commit comments