@@ -69,6 +69,8 @@ type PathPair struct {
6969 // will be "main"
7070 Primary logger.Path
7171 Secondary logger.Path
72+
73+ IsExternal bool
7274}
7375
7476func (pp * PathPair ) iter () []* logger.Path {
@@ -114,8 +116,6 @@ type ResolveResult struct {
114116
115117 // This is the "type" field from "package.json"
116118 ModuleTypeData js_ast.ModuleTypeData
117-
118- IsExternal bool
119119}
120120
121121type suggestionRange uint8
@@ -431,8 +431,7 @@ func (res *Resolver) Resolve(sourceDir string, importPath string, kind ast.Impor
431431
432432 r .flushDebugLogs (flushDueToSuccess )
433433 return & ResolveResult {
434- PathPair : PathPair {Primary : logger.Path {Text : importPath }},
435- IsExternal : true ,
434+ PathPair : PathPair {Primary : logger.Path {Text : importPath }, IsExternal : true },
436435 }, debugMeta
437436 }
438437
@@ -444,8 +443,7 @@ func (res *Resolver) Resolve(sourceDir string, importPath string, kind ast.Impor
444443
445444 r .flushDebugLogs (flushDueToSuccess )
446445 return & ResolveResult {
447- PathPair : PathPair {Primary : logger.Path {Text : importPath }},
448- IsExternal : true ,
446+ PathPair : PathPair {Primary : logger.Path {Text : importPath }, IsExternal : true },
449447 PrimarySideEffectsData : & SideEffectsData {}, // Mark this with "sideEffects: false"
450448 }, debugMeta
451449 }
@@ -491,8 +489,7 @@ func (res *Resolver) Resolve(sourceDir string, importPath string, kind ast.Impor
491489
492490 r .flushDebugLogs (flushDueToSuccess )
493491 return & ResolveResult {
494- PathPair : PathPair {Primary : logger.Path {Text : importPath }},
495- IsExternal : true ,
492+ PathPair : PathPair {Primary : logger.Path {Text : importPath }, IsExternal : true },
496493 PrimarySideEffectsData : sideEffects ,
497494 }, debugMeta
498495 }
@@ -516,8 +513,7 @@ func (res *Resolver) Resolve(sourceDir string, importPath string, kind ast.Impor
516513 }
517514 r .flushDebugLogs (flushDueToSuccess )
518515 return & ResolveResult {
519- PathPair : PathPair {Primary : logger.Path {Text : importPath }},
520- IsExternal : true ,
516+ PathPair : PathPair {Primary : logger.Path {Text : importPath }, IsExternal : true },
521517 }, debugMeta
522518 }
523519
@@ -730,8 +726,7 @@ func (res *Resolver) ResolveGlob(sourceDir string, importPathPattern []helpers.G
730726 var result ResolveResult
731727
732728 if r .isExternal (r .options .ExternalSettings .PreResolve , relPath , kind ) {
733- result .PathPair = PathPair {Primary : logger.Path {Text : relPath }}
734- result .IsExternal = true
729+ result .PathPair = PathPair {Primary : logger.Path {Text : relPath }, IsExternal : true }
735730
736731 if r .debugLogs != nil {
737732 r .debugLogs .addNote (fmt .Sprintf ("The path %q was marked as external by the user" , result .PathPair .Primary .Text ))
@@ -847,11 +842,11 @@ func (r resolverQuery) flushDebugLogs(mode flushMode) {
847842}
848843
849844func (r resolverQuery ) finalizeResolve (result * ResolveResult ) {
850- if ! result .IsExternal && r .isExternal (r .options .ExternalSettings .PostResolve , result .PathPair .Primary .Text , r .kind ) {
845+ if ! result .PathPair . IsExternal && r .isExternal (r .options .ExternalSettings .PostResolve , result .PathPair .Primary .Text , r .kind ) {
851846 if r .debugLogs != nil {
852847 r .debugLogs .addNote (fmt .Sprintf ("The path %q was marked as external by the user" , result .PathPair .Primary .Text ))
853848 }
854- result .IsExternal = true
849+ result .PathPair . IsExternal = true
855850 } else {
856851 for i , path := range result .PathPair .iter () {
857852 if path .Namespace != "file" {
@@ -1024,8 +1019,7 @@ func (r resolverQuery) resolveWithoutSymlinks(sourceDir string, sourceDirInfo *d
10241019
10251020 r .flushDebugLogs (flushDueToSuccess )
10261021 return & ResolveResult {
1027- PathPair : PathPair {Primary : logger.Path {Text : importPath }},
1028- IsExternal : true ,
1022+ PathPair : PathPair {Primary : logger.Path {Text : importPath }, IsExternal : true },
10291023 }
10301024 }
10311025
@@ -1037,7 +1031,7 @@ func (r resolverQuery) resolveWithoutSymlinks(sourceDir string, sourceDirInfo *d
10371031 if r .debugLogs != nil {
10381032 r .debugLogs .addNote (fmt .Sprintf ("The path %q was marked as external by the user" , absPath ))
10391033 }
1040- return & ResolveResult {PathPair : PathPair {Primary : logger.Path {Text : absPath , Namespace : "file" }} , IsExternal : true }
1034+ return & ResolveResult {PathPair : PathPair {Primary : logger.Path {Text : absPath , Namespace : "file" }, IsExternal : true } }
10411035 }
10421036
10431037 // Check the "browser" map
0 commit comments