File tree 5 files changed +16
-28
lines changed
packages/angular_devkit/build_angular/src
5 files changed +16
-28
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ import * as os from 'os';
11
11
import * as path from 'path' ;
12
12
import { serialize } from 'v8' ;
13
13
import { BundleActionCache } from './action-cache' ;
14
+ import { maxWorkers } from './environment-options' ;
14
15
import { I18nOptions } from './i18n-options' ;
15
16
import { InlineOptions , ProcessBundleOptions , ProcessBundleResult } from './process-bundle' ;
16
- import { maxWorkers } from './workers' ;
17
17
18
18
let workerFile = require . resolve ( './process-bundle' ) ;
19
19
workerFile =
@@ -35,7 +35,7 @@ export class BundleActionExecutor {
35
35
}
36
36
37
37
private static executeMethod < O > ( worker : JestWorker , method : string , input : unknown ) : Promise < O > {
38
- return ( ( worker as unknown ) as Record < string , ( i : unknown ) => Promise < O > > ) [ method ] ( input ) ;
38
+ return ( worker as unknown as Record < string , ( i : unknown ) => Promise < O > > ) [ method ] ( input ) ;
39
39
}
40
40
41
41
private ensureLarge ( ) : JestWorker {
Original file line number Diff line number Diff line change @@ -83,3 +83,15 @@ export const cachingBasePath = (() => {
83
83
// Build profiling
84
84
const profilingVariable = process . env [ 'NG_BUILD_PROFILING' ] ;
85
85
export const profilingEnabled = isPresent ( profilingVariable ) && isEnabled ( profilingVariable ) ;
86
+
87
+ /**
88
+ * Some environments, like CircleCI which use Docker report a number of CPUs by the host and not the count of available.
89
+ * This cause `Error: Call retries were exceeded` errors when trying to use them.
90
+ *
91
+ * @see https://github.com/nodejs/node/issues/28762
92
+ * @see https://github.com/webpack-contrib/terser-webpack-plugin/issues/143
93
+ * @see https://ithub.com/angular/angular-cli/issues/16860#issuecomment-588828079
94
+ *
95
+ */
96
+ const maxWorkersVariable = process . env [ 'NG_BUILD_MAX_WORKERS' ] ;
97
+ export const maxWorkers = isPresent ( maxWorkersVariable ) ? + maxWorkersVariable : 4 ;
Original file line number Diff line number Diff line change @@ -16,4 +16,3 @@ export * from './normalize-source-maps';
16
16
export * from './normalize-optimization' ;
17
17
export * from './normalize-builder-schema' ;
18
18
export * from './url' ;
19
- export * from './workers' ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,13 +23,14 @@ import {
23
23
debug ,
24
24
} from 'webpack' ;
25
25
import { AssetPatternClass } from '../../browser/schema' ;
26
- import { BuildBrowserFeatures , maxWorkers } from '../../utils' ;
26
+ import { BuildBrowserFeatures } from '../../utils' ;
27
27
import { WebpackConfigOptions } from '../../utils/build-options' ;
28
28
import { findCachePath } from '../../utils/cache-path' ;
29
29
import {
30
30
allowMangle ,
31
31
allowMinify ,
32
32
cachingDisabled ,
33
+ maxWorkers ,
33
34
profilingEnabled ,
34
35
shouldBeautify ,
35
36
} from '../../utils/environment-options' ;
You can’t perform that action at this time.
0 commit comments