File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ class ResolutionContext {
105105 if ( p . moduleResolution != null ) {
106106 const pluginResolvedPath = p . moduleResolution ( dependency , dependencyPath )
107107 if ( pluginResolvedPath !== undefined ) {
108- // If node module
108+
109+ // If lua file is in node_module
109110 if ( requiredFromLuaFile && isNodeModulesFile ( required . fileName ) ) {
110111 // If requiring file is in lua module, try to resolve sibling in that file first
111112 const resolvedNodeModulesFile = this . resolveLuaDependencyPathFromNodeModules ( required , pluginResolvedPath ) ;
@@ -115,16 +116,17 @@ class ResolutionContext {
115116 }
116117 return resolvedNodeModulesFile
117118 }
118- } else if ( this . getFileFromPath ( pluginResolvedPath ) ) {
119+ }
120+
121+ if ( this . getFileFromPath ( pluginResolvedPath ) ) {
119122 console . log ( `Resolved file path for module ${ dependency } to path ${ dependencyPath } using plugin.` )
120123 return pluginResolvedPath ;
121124 }
122125 }
123126 }
124127 } catch ( e : any ) {
125- // resolveSync errors if it fails to resolve
128+ // if plugin throws an error
126129 if ( this . options . tstlVerbose ) {
127- // Output resolver log
128130 console . log ( e . details ?? e ) ;
129131 }
130132 }
You can’t perform that action at this time.
0 commit comments