Skip to content

Commit

Permalink
fix(@angular/build): Ctrl + C not terminating dev-server with SSR
Browse files Browse the repository at this point in the history
This commit provides a workaround for #28336, which occurs due to the interaction between `zone.js` and `listr2`. The issue prevents proper termination of the development server using Ctrl + C when dev-server.

Closes: #28336
  • Loading branch information
alan-agius4 committed Oct 9, 2024
1 parent 9b5cfaa commit 9445916
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/angular/build/src/builders/dev-server/vite-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ export async function* serveWithVite(

// https://nodejs.org/api/process.html#processsetsourcemapsenabledval
process.setSourceMapsEnabled(true);

if (browserOptions.progress !== false) {
// This is a workaround for https://github.com/angular/angular-cli/issues/28336, which is caused by the interaction between `zone.js` and `listr2`.
process.once('SIGINT', () => {
process.kill(process.pid);
});
}
}

// Set all packages as external to support Vite's prebundle caching
Expand Down

0 comments on commit 9445916

Please sign in to comment.