Skip to content

Commit 9445916

Browse files
committed
fix(@angular/build): Ctrl + C not terminating dev-server with SSR
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
1 parent 9b5cfaa commit 9445916

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/angular/build/src/builders/dev-server/vite-server.ts

+7
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ export async function* serveWithVite(
101101

102102
// https://nodejs.org/api/process.html#processsetsourcemapsenabledval
103103
process.setSourceMapsEnabled(true);
104+
105+
if (browserOptions.progress !== false) {
106+
// This is a workaround for https://github.com/angular/angular-cli/issues/28336, which is caused by the interaction between `zone.js` and `listr2`.
107+
process.once('SIGINT', () => {
108+
process.kill(process.pid);
109+
});
110+
}
104111
}
105112

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

0 commit comments

Comments
 (0)