Skip to content

Commit a037d6a

Browse files
clydindgp1130
authored andcommitted
refactor(@angular-devkit/build-angular): increase JS transformer worker pool idle timeout to 1 second
The idle timeout for threads in the JavaScript transformer worker pool for the esbuild-based builders (`application`/`browser-esbuild`) is now set at 1 second. This prevents the default of immediate shutdown of an idle worker from occurring. The immediate shutdown causes additional worker threads to be created due to the variable time between bundler requests for node module JavaScript files. The shutdown and subsequent recreation of the threads during the build causes unneeded extra processing that can now be avoided. (cherry picked from commit 26c3b82)
1 parent 01ab16c commit a037d6a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/javascript-transformer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export class JavaScriptTransformer {
3434
filename: require.resolve('./javascript-transformer-worker'),
3535
minThreads: 1,
3636
maxThreads,
37+
// Shutdown idle threads after 1 second of inactivity
38+
idleTimeout: 1000,
3739
});
3840

3941
// Extract options to ensure only the named options are serialized and sent to the worker

0 commit comments

Comments
 (0)