Skip to content

Commit e60715e

Browse files
committed
Use typeTest in isExternalModule and isExternalModuleMain
1 parent 69c767e commit e60715e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/importType.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ export function isExternalModule(name, settings, path, context) {
3434
if (arguments.length < 4) {
3535
throw new TypeError('isExternalModule: name, settings, path, and context are all required');
3636
}
37-
return (isModule(name) || isScoped(name)) && (isExternalPath(path, context) || isExternalLookingName(name));
37+
return (isModule(name) || isScoped(name)) && typeTest(name, context, path) === 'external';
3838
}
3939

4040
export function isExternalModuleMain(name, settings, path, context) {
41-
return isModuleMain(name) && (isExternalPath(path, context) || isExternalLookingName(name));
41+
return isModuleMain(name) && typeTest(name, context, path) === 'external';
4242
}
4343

4444
const moduleRegExp = /^\w/;
@@ -106,7 +106,7 @@ function isExternalLookingName(name) {
106106
return isModule(name) || isScoped(name);
107107
}
108108

109-
function typeTest(name, context, path) {
109+
function typeTest(name, context, path, settings) {
110110
const { settings } = context;
111111
if (isInternalRegexMatch(name, settings)) { return 'internal'; }
112112
if (isAbsolute(name, settings, path)) { return 'absolute'; }

0 commit comments

Comments
 (0)