Skip to content

Commit 59cdb29

Browse files
committed
fix: not working as module import
1 parent 78e938d commit 59cdb29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ function createTSServerInstance() {
1414
/**
1515
* Initializes the TypeScript Server process.
1616
*/
17-
function initTSServer() {
17+
function initTSServer(node = "", tsServer = "") {
1818
return new Promise((resolve, reject) => {
1919
const __dirname = path.dirname(fileURLToPath(import.meta.url));
20-
const tsserverPath = path.join(__dirname, '..', '..', 'node_modules', 'typescript', 'bin', 'tsserver');
21-
const nodePath = 'node';
20+
const tsserverPath = (tsServer) ? tsServer : path.join(__dirname, '..', '..', 'node_modules', 'typescript', 'bin', 'tsserver');
21+
const nodePath = (!node) ? 'node' : node;
2222
tsserverProcess = spawn(nodePath, [tsserverPath]);
2323
tsserverProcess.stdout.setEncoding('utf8');
2424

0 commit comments

Comments
 (0)