Skip to content

Commit

Permalink
fix: enable pnp for typingsInstaller and watchGuard (microsoft#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz authored Apr 27, 2021
1 parent b8cb076 commit 58bf162
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tsserver/nodeServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ namespace ts.server {
}
try {
const args = [combinePaths(__dirname, "watchGuard.js"), path];
if (typeof process.versions.pnp !== "undefined") {
args.unshift('-r', require.resolve('pnpapi'));
}
if (logger.hasLevel(LogLevel.verbose)) {
logger.info(`Starting ${process.execPath} with args:${stringifyIndented(args)}`);
}
Expand Down Expand Up @@ -597,6 +600,10 @@ namespace ts.server {
}
}

if (typeof process.versions.pnp !== "undefined") {
execArgv.unshift('-r', require.resolve('pnpapi'));
}

this.installer = childProcess.fork(combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv });
this.installer.on("message", m => this.handleMessage(m));

Expand Down

0 comments on commit 58bf162

Please sign in to comment.