Skip to content

Commit 58bf162

Browse files
authored
fix: enable pnp for typingsInstaller and watchGuard (microsoft#8)
1 parent b8cb076 commit 58bf162

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
@@ -210,6 +210,9 @@ namespace ts.server {
210210
}
211211
try {
212212
const args = [combinePaths(__dirname, "watchGuard.js"), path];
213+
if (typeof process.versions.pnp !== "undefined") {
214+
args.unshift('-r', require.resolve('pnpapi'));
215+
}
213216
if (logger.hasLevel(LogLevel.verbose)) {
214217
logger.info(`Starting ${process.execPath} with args:${stringifyIndented(args)}`);
215218
}
@@ -597,6 +600,10 @@ namespace ts.server {
597600
}
598601
}
599602

603+
if (typeof process.versions.pnp !== "undefined") {
604+
execArgv.unshift('-r', require.resolve('pnpapi'));
605+
}
606+
600607
this.installer = childProcess.fork(combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv });
601608
this.installer.on("message", m => this.handleMessage(m));
602609

0 commit comments

Comments
 (0)