Skip to content

Commit 37187f4

Browse files
replaced some comments and change a conditional statement
1 parent 2a73c57 commit 37187f4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/transpilation/resolve.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)