diff --git a/modules/builders/src/prerender/worker.ts b/modules/builders/src/prerender/worker.ts index 367879045..c3d0e2bf0 100644 --- a/modules/builders/src/prerender/worker.ts +++ b/modules/builders/src/prerender/worker.ts @@ -50,7 +50,10 @@ export async function render( const { renderModule, AppServerModule } = await import(serverBundlePath); - const browserIndexInputPath = path.join(outputPath, workerArgs.indexFile); + const indexBaseName = fs.existsSync(path.join(outputPath, 'index.original.html')) + ? 'index.original.html' + : workerArgs.indexFile; + const browserIndexInputPath = path.join(outputPath, indexBaseName); let indexHtml = await fs.promises.readFile(browserIndexInputPath, 'utf8'); indexHtml = indexHtml.replace( '',