Skip to content

Commit

Permalink
fix(@ngtools/webpack): don't pass debug args to forked type checker
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed Oct 18, 2017
1 parent b418e8e commit f2bebfe
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/@ngtools/webpack/src/angular_compiler_plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs';
import { fork, ChildProcess } from 'child_process';
import { fork, ForkOptions, ChildProcess } from 'child_process';
import * as path from 'path';
import * as ts from 'typescript';

Expand Down Expand Up @@ -458,7 +458,17 @@ export class AngularCompilerPlugin implements Tapable {
? './type_checker_bootstrap.js'
: './type_checker.js';

this._typeCheckerProcess = fork(path.resolve(__dirname, typeCheckerFile));

const execArgv = process.execArgv.filter((arg) => {
// Remove debug args.
// Workaround for https://github.com/nodejs/node/issues/9435
const debugArgRegex = /--inspect(?:-brk|-port)?|--debug(?:-brk|-port)/;
return !debugArgRegex.test(arg);
});

const forkOptions: ForkOptions = { execArgv };

this._typeCheckerProcess = fork(path.resolve(__dirname, typeCheckerFile), [], forkOptions);
this._typeCheckerProcess.send(new InitMessage(this._compilerOptions, this._basePath,
this._JitMode, this._tsFilenames));

Expand Down

0 comments on commit f2bebfe

Please sign in to comment.