@@ -34,11 +34,11 @@ export function isExternalModule(name, settings, path, context) {
34
34
if ( arguments . length < 4 ) {
35
35
throw new TypeError ( 'isExternalModule: name, settings, path, and context are all required' ) ;
36
36
}
37
- return ( isModule ( name ) || isScoped ( name ) ) && ( isExternalPath ( path , context ) || isExternalLookingName ( name ) ) ;
37
+ return ( isModule ( name ) || isScoped ( name ) ) && typeTest ( name , context , path ) === 'external' ;
38
38
}
39
39
40
40
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' ;
42
42
}
43
43
44
44
const moduleRegExp = / ^ \w / ;
@@ -106,7 +106,7 @@ function isExternalLookingName(name) {
106
106
return isModule ( name ) || isScoped ( name ) ;
107
107
}
108
108
109
- function typeTest ( name , context , path ) {
109
+ function typeTest ( name , context , path , settings ) {
110
110
const { settings } = context ;
111
111
if ( isInternalRegexMatch ( name , settings ) ) { return 'internal' ; }
112
112
if ( isAbsolute ( name , settings , path ) ) { return 'absolute' ; }
0 commit comments