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 3333 "live-plugin-manager" : " ^0.18.1" ,
3434 "lodash" : " ^4.17.21" ,
3535 "ora" : " ^5.4.1" ,
36- "semver" : " ^7.3.5"
37- },
38- "devDependencies" : {
36+ "semver" : " ^7.3.5" ,
3937 "tsx" : " ^4.19.1"
4038 },
4139 "engines" : {
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ import { installPackage } from '@antfu/install-pkg';
44
55import { ModuleLoader } from '@hypermod/fetcher' ;
66
7+ /**
8+ * Register the TSX plugin to allow require TS(X) files.
9+ */
10+ import { register } from 'tsx/esm/api' ;
11+ register ( ) ;
12+
713const ModuleLoader = ( config : {
814 npmRegistryUrl ?: string ;
915 authToken ?: string ;
@@ -59,7 +65,7 @@ const ModuleLoader = (config: {
5965 return {
6066 install,
6167 getInfo,
62- require : ( packageName : string ) => require ( packageName ) ,
68+ require : ( packageName : string ) => await import ( packageName ) ,
6369 } ;
6470} ;
6571
You can’t perform that action at this time.
0 commit comments