diff --git a/packages/tsc/index.ts b/packages/tsc/index.ts index 8eae1f29be..1ba58bdf9a 100644 --- a/packages/tsc/index.ts +++ b/packages/tsc/index.ts @@ -1,10 +1,9 @@ import { runTsc } from '@volar/typescript/lib/quickstart/runTsc'; import * as vue from '@vue/language-core'; -import * as semver from 'semver'; const windowsPathReg = /\\/g; -export function run(tscPath = getTscPath()) { +export function run(tscPath = require.resolve('typescript/lib/tsc')) { let runExtensions = ['.vue']; @@ -47,14 +46,3 @@ export function run(tscPath = getTscPath()) { } } } - -function getTscPath() { - const version = require('typescript/package.json').version as string; - - if (semver.gte(version, '5.7.0')) { - return require.resolve('typescript/lib/_tsc'); - } - else { - return require.resolve('typescript/lib/tsc'); - } -} diff --git a/packages/tsc/package.json b/packages/tsc/package.json index 799fb4567d..ee411e8b79 100644 --- a/packages/tsc/package.json +++ b/packages/tsc/package.json @@ -18,14 +18,12 @@ }, "dependencies": { "@volar/typescript": "~2.4.11", - "@vue/language-core": "2.1.10", - "semver": "^7.5.4" + "@vue/language-core": "2.1.10" }, "peerDependencies": { "typescript": ">=5.0.0" }, "devDependencies": { - "@types/node": "latest", - "@types/semver": "^7.5.4" + "@types/node": "latest" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1837a0aa6b..686d4f0fbc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -269,9 +269,6 @@ importers: '@vue/language-core': specifier: 2.1.10 version: link:../language-core - semver: - specifier: ^7.5.4 - version: 7.6.3 typescript: specifier: '>=5.0.0' version: 5.7.2 @@ -279,9 +276,6 @@ importers: '@types/node': specifier: latest version: 22.10.2 - '@types/semver': - specifier: ^7.5.4 - version: 7.5.8 packages/typescript-plugin: dependencies: