Skip to content

Commit

Permalink
Use typeTest in isExternalModule and isExternalModuleMain
Browse files Browse the repository at this point in the history
  • Loading branch information
ombene committed Dec 22, 2021
1 parent 69c767e commit 02c1dfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/importType.js
Expand Up @@ -34,11 +34,11 @@ export function isExternalModule(name, settings, path, context) {
if (arguments.length < 4) {
throw new TypeError('isExternalModule: name, settings, path, and context are all required');
}
return (isModule(name) || isScoped(name)) && (isExternalPath(path, context) || isExternalLookingName(name));
return (isModule(name) || isScoped(name)) && typeTest(name, context, path) === 'external';
}

export function isExternalModuleMain(name, settings, path, context) {
return isModuleMain(name) && (isExternalPath(path, context) || isExternalLookingName(name));
return isModuleMain(name) && typeTest(name, context, path) === 'external';
}

const moduleRegExp = /^\w/;
Expand Down

0 comments on commit 02c1dfb

Please sign in to comment.