提交 1bfad134 编写于 作者: M Matt Bierner

Set NODE_PATH when forking TS server

The ensures that we can resolve require('typescript') inside of plugins correctly
上级 56230836
......@@ -7,7 +7,7 @@
const fs = require('fs');
const path = require('path');
const toDelete = new Set(['tsc.js', 'tsserverlibrary.js', 'typescriptServices.js']);
const toDelete = new Set(['tsc.js', 'typescriptServices.js']);
const root = path.join(__dirname, 'node_modules', 'typescript', 'lib');
for (let name of fs.readdirSync(root)) {
......
......@@ -94,6 +94,7 @@ export function fork(
const newEnv = generatePatchedEnv(process.env, stdInPipeName, stdOutPipeName, stdErrPipeName);
newEnv['NODE_PATH'] = path.join(modulePath, '..', '..', '..');
let childProcess: cp.ChildProcess;
// Begin listening to stderr pipe
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册