Skip to content

Commit 856d3f0

Browse files
authored
test: detect ts support via process.features (vitejs#20544)
1 parent 8d31eea commit 856d3f0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/vite/src/node/__tests__/runnerImport.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import { loadConfigFromFile } from 'vite'
44
import { runnerImport } from '../ssr/runnerImport'
55
import { slash } from '../../shared/utils'
66

7-
const [nvMajor, nvMinor] = process.versions.node.split('.').map(Number)
8-
const isTypeStrippingSupported =
9-
(nvMajor === 23 && nvMinor >= 6) || nvMajor >= 24
7+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
8+
const isTypeStrippingSupported = !!process.features.typescript
109

1110
describe('importing files using inlined environment', () => {
1211
const fixture = (name: string) =>

0 commit comments

Comments
 (0)