@@ -4,6 +4,9 @@ import { loadConfigFromFile } from 'vite'
4
4
import { runnerImport } from '../ssr/runnerImport'
5
5
import { slash } from '../../shared/utils'
6
6
7
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
8
+ const isTypeStrippingSupported = ! ! process . features . typescript
9
+
7
10
describe ( 'importing files using inlined environment' , ( ) => {
8
11
const fixture = ( name : string ) =>
9
12
resolve ( import . meta. dirname , './fixtures/runner-import' , name )
@@ -51,15 +54,17 @@ describe('importing files using inlined environment', () => {
51
54
] )
52
55
53
56
// confirm that it fails with a bundle approach
54
- await expect ( async ( ) => {
55
- const root = resolve ( import . meta. dirname , './fixtures/runner-import' )
56
- await loadConfigFromFile (
57
- { mode : 'production' , command : 'serve' } ,
58
- resolve ( root , './vite.config.outside-pkg-import.mts' ) ,
59
- root ,
60
- 'silent' ,
61
- )
62
- } ) . rejects . toThrow ( 'Unknown file extension ".ts"' )
57
+ if ( ! isTypeStrippingSupported ) {
58
+ await expect ( async ( ) => {
59
+ const root = resolve ( import . meta. dirname , './fixtures/runner-import' )
60
+ await loadConfigFromFile (
61
+ { mode : 'production' , command : 'serve' } ,
62
+ resolve ( root , './vite.config.outside-pkg-import.mts' ) ,
63
+ root ,
64
+ 'silent' ,
65
+ )
66
+ } ) . rejects . toThrow ( 'Unknown file extension ".ts"' )
67
+ }
63
68
} )
64
69
65
70
test ( 'dynamic import' , async ( ) => {
0 commit comments