File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -4,4 +4,26 @@ const require = createRequire(fileURLToPath(import.meta.url));
4
4
5
5
/** @type {import('./dist/esm') } */
6
6
const esm = require ( './dist/esm' ) ;
7
- export const { resolve, load, getFormat, transformSource } = esm . registerAndCreateEsmHooks ( ) ;
7
+
8
+ /** @type {ReturnType<typeof esm['registerAndCreateEsmHooks']> | undefined } */
9
+ let loader = undefined ;
10
+
11
+ export function resolve ( ...args ) {
12
+ return loader . resolve . apply ( this , args ) ;
13
+ }
14
+
15
+ export function load ( ...args ) {
16
+ return loader . load . apply ( this , args ) ;
17
+ }
18
+
19
+ export function getFormat ( ...args ) {
20
+ return loader . getFormat . apply ( this , args ) ;
21
+ }
22
+
23
+ export function transformSource ( ...args ) {
24
+ return loader . transformSource . apply ( this , args ) ;
25
+ }
26
+
27
+ export function initialize ( tsNodeOptions ) {
28
+ loader = esm . registerAndCreateEsmHooks ( tsNodeOptions ) ;
29
+ }
You can’t perform that action at this time.
0 commit comments