Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dffade0

Browse files
authoredDec 13, 2024··
feat: support vscode with tsx (#13)
1 parent 7fa167f commit dffade0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎src/detect.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,14 @@ async function isRuntimeSupportsTsx() {
135135
) {
136136
return false
137137
}
138-
// Disable in Electron
138+
139+
// not supported in vscode < 1.96: https://github.com/microsoft/vscode/issues/224426
140+
// magic number 10629634 is from
141+
// https://github.com/microsoft/vscode/blob/bee3e32d012157a94cbc431080b743775fe713c5/.npmrc
142+
139143
// eslint-disable-next-line node/prefer-global/process
140-
if (typeof process !== 'undefined' && typeof process.versions.electron === 'string') {
144+
const msBuildVersion = typeof process !== 'undefined' && process.versions['microsoft-build']
145+
if (msBuildVersion && Number(msBuildVersion) < 10629634) {
141146
return false
142147
}
143148
return true

0 commit comments

Comments
 (0)
Please sign in to comment.