Skip to content

Commit f0582ff

Browse files
committed
fixup! refactor(@angular/build): use new Angular SSR API
1 parent 90eedcf commit f0582ff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/angular/build/src/builders/application/execute-post-bundle.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function executePostBundleSteps(
5252
const prerenderedRoutes: string[] = [];
5353

5454
const {
55-
baseHref,
55+
baseHref = '/',
5656
serviceWorker,
5757
indexHtmlOptions,
5858
optimizationOptions,
@@ -148,9 +148,10 @@ export async function executePostBundleSteps(
148148
// Update the index contents with the app shell under these conditions:
149149
// - Replace 'index.html' with the app shell only if it hasn't been prerendered yet.
150150
// - Always replace 'index.csr.html' with the app shell.
151+
const filePath = appShellRoute && !indexHasBeenPrerendered ? indexHtmlOptions.output : path;
151152
additionalHtmlOutputFiles.set(
152-
appShellRoute && !indexHasBeenPrerendered ? indexHtmlOptions.output : path,
153-
createOutputFile(path, content, BuildOutputFileType.Browser),
153+
filePath,
154+
createOutputFile(filePath, content, BuildOutputFileType.Browser),
154155
);
155156
}
156157

@@ -178,7 +179,7 @@ export async function executePostBundleSteps(
178179
const serviceWorkerResult = await augmentAppWithServiceWorkerEsbuild(
179180
workspaceRoot,
180181
serviceWorker,
181-
options.baseHref || '/',
182+
baseHref,
182183
options.indexHtmlOptions?.output,
183184
// Ensure additional files recently added are used
184185
[...outputFiles, ...additionalOutputFiles],

0 commit comments

Comments
 (0)