File tree 1 file changed +9
-1
lines changed
packages/vite/src/node/optimizer
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import type { PluginContainer } from '../server/pluginContainer'
36
36
import { createPluginContainer } from '../server/pluginContainer'
37
37
import { transformGlobImport } from '../plugins/importMetaGlob'
38
38
import { cleanUrl } from '../../shared/utils'
39
+ import { loadTsconfigJsonForFile } from '../plugins/esbuild'
39
40
40
41
type ResolveIdOptions = Parameters < PluginContainer [ 'resolveId' ] > [ 2 ]
41
42
@@ -1021,7 +1022,14 @@ function rolldownScanPlugin(
1021
1022
const loader = ext as Loader
1022
1023
1023
1024
if ( loader !== 'js' ) {
1024
- contents = ( await transform ( contents , { loader } ) ) . code
1025
+ let tsconfigRaw
1026
+ const tsconfigResult = await loadTsconfigJsonForFile (
1027
+ path . join ( config . root , '_dummy.js' ) ,
1028
+ )
1029
+ if ( tsconfigResult . compilerOptions ?. experimentalDecorators ) {
1030
+ tsconfigRaw = { compilerOptions : { experimentalDecorators : true } }
1031
+ }
1032
+ contents = ( await transform ( contents , { loader, tsconfigRaw } ) ) . code
1025
1033
}
1026
1034
1027
1035
if ( contents . includes ( 'import.meta.glob' ) ) {
You can’t perform that action at this time.
0 commit comments