File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 59
59
" dist"
60
60
],
61
61
"dependencies" : {
62
- "sucrase " : " ^3.35.0 " ,
63
- "jiti " : " ^2.4.1 "
62
+ "jiti " : " ^2.4.1 " ,
63
+ "sucrase " : " ^3.35.0 "
64
64
},
65
65
"devDependencies" : {
66
66
"@master/css" : " 2.0.0-rc.24"
Original file line number Diff line number Diff line change 1
- import { transform } from 'sucrase'
2
- /**
3
- * Use the jiti/dist/jiti module to prevent bundling of redundant dependencies such as babel.
4
- */
5
1
import { createJiti } from 'jiti'
6
2
7
3
export default function crossImport ( modulePath : string ) : any {
@@ -21,15 +17,11 @@ export default function crossImport(modulePath: string): any {
21
17
console . error ( error )
22
18
console . log ( '[cross-import] fall back to sucrase runtime transform:' , modulePath )
23
19
}
24
- return createJiti ( __filename , {
20
+ return createJiti ( import . meta . url , {
25
21
cache : false ,
26
22
debug : ! ! process . env . DEBUG ,
27
- transform : ( options ) => {
28
- return transform ( options . source , {
29
- transforms : [ 'imports' , 'typescript' ] ,
30
- filePath : options . filename
31
- } )
32
- }
23
+ fsCache : false ,
24
+ moduleCache : false ,
33
25
} ) ( modulePath )
34
26
}
35
27
}
You can’t perform that action at this time.
0 commit comments