Skip to content

fix(@ngtools/webpack): remove default type checker memory limit #8306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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