Skip to content

Commit 5061a06

Browse files
wip(core): minor refactoring
1 parent 83c6d9e commit 5061a06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,12 +866,12 @@ export async function loadModule(path : string, options_ : Options = throwNotDef
866866
return moduleCache[path] = module;
867867
}
868868

869-
const moduleHandlers = { ...defaultModuleHandlers, ...additionalModuleHandlers };
870-
871869
const res = await getFile(path);
872870

873871
const file = typeof res === 'object' ? res : { content: res, extname: pathHandlers.extname(path) };
874872

873+
const moduleHandlers = { ...defaultModuleHandlers, ...additionalModuleHandlers };
874+
875875
if ( !(file.extname in moduleHandlers) )
876876
throw new TypeError(`Unable to handle ${ file.extname } files (${ path }), see additionalModuleHandlers`);
877877

0 commit comments

Comments
 (0)