From 9df2c35350db559e18bc7e4ec919490a307a6a08 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 18 May 2022 11:40:36 +0000 Subject: [PATCH 1/2] fix(@angular/cli): `ng doc` doesn't open browser in Windows In Windows, `process.exit` was being called prior of opening the browser which caused the browser never to open. Closes #23105 --- packages/angular/cli/lib/init.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular/cli/lib/init.ts b/packages/angular/cli/lib/init.ts index e39861aaaab9..9b94a248c14c 100644 --- a/packages/angular/cli/lib/init.ts +++ b/packages/angular/cli/lib/init.ts @@ -107,7 +107,7 @@ import { VERSION } from '../src/utilities/version'; }); }) .then((exitCode: number) => { - process.exit(exitCode); + process.exitCode = exitCode; }) .catch((err: Error) => { // eslint-disable-next-line no-console From 76e36cd3ec17df71f79fdac21c35f6746b62ae92 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 18 May 2022 12:40:42 +0000 Subject: [PATCH 2/2] fix(@angular-devkit/build-angular): close compiler on Karma exit The webpack compiler was never closed which caused Webpack's shutdown hook https://github.com/angular/angular-cli/blob/c71832f3a9942aeb2c3dbd62f6edb4f0b8366465/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts#L113-L114 to never be called and in turn caused the Sass workers never to be termined. --- .../build_angular/src/webpack/plugins/karma/karma.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma.ts b/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma.ts index ef429497701a..bfb705f29e26 100644 --- a/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma.ts +++ b/packages/angular_devkit/build_angular/src/webpack/plugins/karma/karma.ts @@ -149,7 +149,7 @@ const init: any = (config: any, emitter: any) => { webpackMiddleware = webpackDevMiddleware(compiler, webpackMiddlewareConfig); emitter.on('exit', (done: any) => { webpackMiddleware.close(); - done(); + compiler.close(() => done()); }); function unblock() {