File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export function collectAssets({
2828 ssrManifest,
2929} : CollectAssetsOpts ) {
3030 const matches = matchRoutes ( [ ...routes ] , locationArg , base )
31+ const routeEntries = matches ?. map ( item => item . route . entry ) . filter ( Boolean ) as string [ ] ?? [ ]
3132 const dynamicImports = new Set < string > ( )
3233 matches ?. forEach ( item => {
3334 let lazyStr = ''
@@ -45,6 +46,7 @@ export function collectAssets({
4546 }
4647 } )
4748 const entries = new Set < string > ( )
49+ routeEntries . forEach ( e => entries . add ( e ) )
4850 const manifestEntries = [ ...Object . entries ( serverManifest ) ]
4951 dynamicImports . forEach ( name => {
5052 const result = manifestEntries . find ( ( [ _ , value ] ) => value . file . endsWith ( name ) )
Original file line number Diff line number Diff line change @@ -142,6 +142,14 @@ export interface ViteReactSSGClientOptions {
142142}
143143
144144interface CommonRouteOptions {
145+ /**
146+ * Used to obtain static resources through manifest
147+ *
148+ * **You are not required to use this field. It is only necessary when "prehydration style loss" occurs.**
149+ *
150+ * @example `src/pages/home.tsx`
151+ */
152+ entry ?: string
145153 /**
146154 * The getStaticPaths() function should return an array of path
147155 * to determine which paths will be pre-rendered by vite-react-ssg.
You can’t perform that action at this time.
0 commit comments