diff --git a/packages/angular_devkit/build_angular/src/utils/server-rendering/prerender.ts b/packages/angular_devkit/build_angular/src/utils/server-rendering/prerender.ts index cd1f91f0c0f3..ac3423bdf3a3 100644 --- a/packages/angular_devkit/build_angular/src/utils/server-rendering/prerender.ts +++ b/packages/angular_devkit/build_angular/src/utils/server-rendering/prerender.ts @@ -121,13 +121,12 @@ export async function prerenderPages( for (const route of allRoutes) { const isAppShellRoute = appShellRoute === route; const serverContext: ServerContext = isAppShellRoute ? 'app-shell' : 'ssg'; - const render: Promise = renderWorker.run({ route, serverContext }); const renderResult: Promise = render.then(({ content, warnings, errors }) => { if (content !== undefined) { const outPath = isAppShellRoute ? 'index.html' - : removeLeadingSlash(posix.join(route, 'index.html')); + : posix.join(removeLeadingSlash(route), 'index.html'); output[outPath] = content; }