Skip to content

Commit 58fbe70

Browse files
committed
fix(@ngtools/webpack): don't pass debug args to forked type checker
1 parent a8c8ac8 commit 58fbe70

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/@ngtools/webpack/src/angular_compiler_plugin.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as fs from 'fs';
2-
import { fork, ChildProcess } from 'child_process';
2+
import { fork, ForkOptions, ChildProcess } from 'child_process';
33
import * as path from 'path';
44
import * as ts from 'typescript';
55

@@ -458,7 +458,17 @@ export class AngularCompilerPlugin implements Tapable {
458458
? './type_checker_bootstrap.js'
459459
: './type_checker.js';
460460

461-
this._typeCheckerProcess = fork(path.resolve(__dirname, typeCheckerFile));
461+
462+
const execArgv = process.execArgv.filter((arg) => {
463+
// Remove debug args.
464+
// Workaround for https://github.com/nodejs/node/issues/9435
465+
const debugArgRegex = /--inspect(?:-brk|-port)?|--debug(?:-brk|-port)/;
466+
return !debugArgRegex.test(arg);
467+
});
468+
469+
const forkOptions: ForkOptions = { execArgv };
470+
471+
this._typeCheckerProcess = fork(path.resolve(__dirname, typeCheckerFile), [], forkOptions);
462472
this._typeCheckerProcess.send(new InitMessage(this._compilerOptions, this._basePath,
463473
this._JitMode, this._tsFilenames));
464474

0 commit comments

Comments
 (0)