@@ -4,6 +4,9 @@ import { loadConfigFromFile } from 'vite'
44import { runnerImport } from '../ssr/runnerImport'
55import { slash } from '../../shared/utils'
66
7+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
8+ const isTypeStrippingSupported = ! ! process . features . typescript
9+
710describe ( 'importing files using inlined environment' , ( ) => {
811 const fixture = ( name : string ) =>
912 resolve ( import . meta. dirname , './fixtures/runner-import' , name )
@@ -51,15 +54,17 @@ describe('importing files using inlined environment', () => {
5154 ] )
5255
5356 // 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+ }
6368 } )
6469
6570 test ( 'dynamic import' , async ( ) => {
0 commit comments