File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 33
33
"live-plugin-manager" : " ^0.18.1" ,
34
34
"lodash" : " ^4.17.21" ,
35
35
"ora" : " ^5.4.1" ,
36
- "semver" : " ^7.3.5"
37
- },
38
- "devDependencies" : {
36
+ "semver" : " ^7.3.5" ,
39
37
"tsx" : " ^4.19.1"
40
38
},
41
39
"engines" : {
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ import { installPackage } from '@antfu/install-pkg';
4
4
5
5
import { ModuleLoader } from '@hypermod/fetcher' ;
6
6
7
+ /**
8
+ * Register the TSX plugin to allow require TS(X) files.
9
+ */
10
+ import { register } from 'tsx/esm/api' ;
11
+ register ( ) ;
12
+
7
13
const ModuleLoader = ( config : {
8
14
npmRegistryUrl ?: string ;
9
15
authToken ?: string ;
@@ -59,7 +65,7 @@ const ModuleLoader = (config: {
59
65
return {
60
66
install,
61
67
getInfo,
62
- require : ( packageName : string ) => require ( packageName ) ,
68
+ require : ( packageName : string ) => await import ( packageName ) ,
63
69
} ;
64
70
} ;
65
71
You can’t perform that action at this time.
0 commit comments