Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions packages/@ngtools/webpack/src/angular_compiler_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,26 +464,14 @@ export class AngularCompilerPlugin implements Tapable {
? './type_checker_bootstrap.js'
: './type_checker.js';

let hasMemoryFlag = false;
const memoryFlagRegex = /--max-old-space-size/;
const debugArgRegex = /--inspect(?:-brk|-port)?|--debug(?:-brk|-port)/;

const execArgv = process.execArgv.filter((arg) => {
// Check if memory is being set by parent process.
if (memoryFlagRegex.test(arg)) {
hasMemoryFlag = true;
}

// Remove debug args.
// Workaround for https://github.com/nodejs/node/issues/9435
return !debugArgRegex.test(arg);
});

if (!hasMemoryFlag) {
// Force max 8gb ram.
execArgv.push('--max-old-space-size=8192');
}

const forkOptions: ForkOptions = { execArgv };

this._typeCheckerProcess = fork(path.resolve(__dirname, typeCheckerFile), [], forkOptions);
Expand Down