Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): do not process ssr entry-point wh…
Browse files Browse the repository at this point in the history
…en running `ng serve`

The ssr entry-point is not used by vite.

(cherry picked from commit 44f2c4e)
  • Loading branch information
alan-agius4 committed Nov 15, 2023
1 parent 160a911 commit 8837719
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ export async function* serveWithVite(
builderName,
)) as json.JsonObject & BrowserBuilderOptions;

if (browserOptions.prerender) {
if (browserOptions.prerender || browserOptions.ssr) {
// Disable prerendering if enabled and force SSR.
// This is so instead of prerendering all the routes for every change, the page is "prerendered" when it is requested.
browserOptions.ssr = true;
browserOptions.prerender = false;

// Avoid bundling and processing the ssr entry-point as this is not used by the dev-server.
browserOptions.ssr = true;

// https://nodejs.org/api/process.html#processsetsourcemapsenabledval
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(process as any).setSourceMapsEnabled(true);
Expand Down

0 comments on commit 8837719

Please sign in to comment.