Skip to content

Commit 1bfad13

Browse files
committed
Set NODE_PATH when forking TS server
The ensures that we can resolve require('typescript') inside of plugins correctly
1 parent 5623083 commit 1bfad13

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

extensions/postinstall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
const fs = require('fs');
99
const path = require('path');
10-
const toDelete = new Set(['tsc.js', 'tsserverlibrary.js', 'typescriptServices.js']);
10+
const toDelete = new Set(['tsc.js', 'typescriptServices.js']);
1111

1212
const root = path.join(__dirname, 'node_modules', 'typescript', 'lib');
1313
for (let name of fs.readdirSync(root)) {

extensions/typescript/src/utils/electron.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export function fork(
9494

9595

9696
const newEnv = generatePatchedEnv(process.env, stdInPipeName, stdOutPipeName, stdErrPipeName);
97+
newEnv['NODE_PATH'] = path.join(modulePath, '..', '..', '..');
9798
let childProcess: cp.ChildProcess;
9899

99100
// Begin listening to stderr pipe

0 commit comments

Comments
 (0)