From 00cc596fe83fb4f4206b00e6a21975862dfd60e5 Mon Sep 17 00:00:00 2001 From: Javier Infante Date: Sun, 19 Sep 2021 17:55:52 +0200 Subject: [PATCH] fix(@nguniversal/builders): index.original.html should be used if exists (cherry picked from commit 6ba411cd8c8c18d2f334d7182fee65402a118d42) --- modules/builders/src/prerender/worker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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( '',