There was an error while loading. Please reload this page.
1 parent 114331b commit 23389ceCopy full SHA for 23389ce
1 file changed
src/index.ts
@@ -547,15 +547,11 @@ export function register(serviceOrOpts: Service | RegisterOptions | undefined):
547
548
Module.registerHooks({
549
load(url, context, nextLoad) {
550
- if (url.endsWith('.ts') && context.format === null) {
551
- require(fileURLToPath(url));
552
- return {
553
- format: 'commonjs',
554
- source: '',
555
- shortCircuit: true,
556
- };
557
- }
558
- if (context.format === 'commonjs-typescript' && !urls[url]) {
+ const isTypeScript =
+ (url.endsWith('.ts') && context.format === null) ||
+ (context.format === 'commonjs-typescript');
+
+ if (isTypeScript && !urls[url]) {
559
urls[url] = true;
560
561
require(fileURLToPath(url));
0 commit comments