Skip to content

Commit

Permalink
fix(@nguniversal/builders): index.original.html should be used if exists
Browse files Browse the repository at this point in the history
(cherry picked from commit 6ba411c)
  • Loading branch information
jabiinfante authored and alan-agius4 committed Sep 21, 2021
1 parent 3e9ed09 commit 00cc596
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/builders/src/prerender/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'</html>',
Expand Down

0 comments on commit 00cc596

Please sign in to comment.