@@ -150,7 +150,7 @@ async function recursivelyRender(
150
150
function insertChunkLoadingScript (
151
151
indexHtmlTree : CheerioAPI ,
152
152
renderPath : string ,
153
- vite : boolean
153
+ forVite : boolean
154
154
) {
155
155
const prerenderRoutes = detectPrerenderRoutes ( )
156
156
@@ -175,7 +175,7 @@ function insertChunkLoadingScript(
175
175
176
176
const chunkPaths : Array < string > = [ ]
177
177
178
- if ( ! vite ) {
178
+ if ( ! forVite ) {
179
179
// Webpack
180
180
181
181
const pageChunkPath = buildManifest [ `${ route ?. pageIdentifier } .js` ]
@@ -219,7 +219,7 @@ function insertChunkLoadingScript(
219
219
} )
220
220
}
221
221
}
222
- } else if ( vite && route ?. filePath ) {
222
+ } else if ( forVite && route ?. filePath ) {
223
223
const pagesIndex =
224
224
route . filePath . indexOf ( path . join ( 'web' , 'src' , 'pages' ) ) + 8
225
225
const pagePath = ensurePosixPath ( route . filePath . slice ( pagesIndex ) )
@@ -245,12 +245,12 @@ function insertChunkLoadingScript(
245
245
chunkPaths . forEach ( ( chunkPath ) => {
246
246
indexHtmlTree ( 'head' ) . prepend (
247
247
`<script defer="defer" src="${ chunkPath } " ${
248
- vite ? 'type="module"' : ''
248
+ forVite ? 'type="module"' : ''
249
249
} ></script>`
250
250
)
251
251
} )
252
252
253
- if ( ! vite ) {
253
+ if ( ! forVite ) {
254
254
return
255
255
}
256
256
@@ -323,12 +323,12 @@ export const runPrerender = async ({
323
323
} )
324
324
325
325
const gqlHandler = await getGqlHandler ( )
326
- const vite = getConfig ( ) . web . bundler !== 'webpack'
326
+ const forVite = getConfig ( ) . web . bundler !== 'webpack'
327
327
328
328
// Prerender specific configuration
329
329
// extends projects web/babelConfig
330
330
registerWebSideBabelHook ( {
331
- forVite : vite ,
331
+ forVite,
332
332
overrides : [
333
333
{
334
334
plugins : [
@@ -400,7 +400,7 @@ export const runPrerender = async ({
400
400
// or possible cache merge conflicts
401
401
prerenderApolloClient . resetStore ( )
402
402
403
- insertChunkLoadingScript ( indexHtmlTree , renderPath , vite )
403
+ insertChunkLoadingScript ( indexHtmlTree , renderPath , forVite )
404
404
405
405
indexHtmlTree ( '#redwood-app' ) . append ( componentAsHtml )
406
406
0 commit comments