Skip to content

Commit 5d89178

Browse files
committed
fix: enable pnp for typingsInstaller and watchGuard (microsoft#9)
1 parent 530aad1 commit 5d89178

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tsserver/nodeServer.ts

+7
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ namespace ts.server {
195195
}
196196
try {
197197
const args = [combinePaths(__dirname, "watchGuard.js"), path];
198+
if (typeof process.versions.pnp !== "undefined") {
199+
args.unshift('-r', require.resolve('pnpapi'));
200+
}
198201
if (logger.hasLevel(LogLevel.verbose)) {
199202
logger.info(`Starting ${process.execPath} with args:${stringifyIndented(args)}`);
200203
}
@@ -507,6 +510,10 @@ namespace ts.server {
507510
}
508511
}
509512

513+
if (typeof process.versions.pnp !== "undefined") {
514+
execArgv.unshift('-r', require.resolve('pnpapi'));
515+
}
516+
510517
this.installer = childProcess.fork(combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv });
511518
this.installer.on("message", m => this.handleMessage(m));
512519

0 commit comments

Comments
 (0)