X Tutup
Skip to content

Commit 88a9478

Browse files
authored
Fix module resolution exploding (#1220)
* Fix module resolution exploding * updated snapshot
1 parent f64a7aa commit 88a9478

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/transpilation/resolve.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function resolveFileDependencies(file: ProcessedFile, context: ResolutionContext
161161
dependencies.push(...resolvedDependency.resolvedFiles);
162162
diagnostics.push(...resolvedDependency.diagnostics);
163163
}
164-
return { resolvedFiles: dependencies, diagnostics };
164+
return { resolvedFiles: deduplicateResolvedFiles(dependencies), diagnostics };
165165
}
166166

167167
function resolveDependency(
@@ -174,7 +174,7 @@ function resolveDependency(
174174

175175
const fileDirectory = path.dirname(requiringFile.fileName);
176176
if (options.tstlVerbose) {
177-
console.log(`Resolving "${dependency}" from ${normalizeSlashes(fileDirectory)}`);
177+
console.log(`Resolving "${dependency}" from ${normalizeSlashes(requiringFile.fileName)}`);
178178
}
179179

180180
// Check if the import is relative

test/transpile/__snapshots__/project.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Array [
1111
"Constructing emit plan",
1212
"Resolving dependencies for <cwd>/test/transpile/project/otherFile.ts",
1313
"Resolving dependencies for <cwd>/test/transpile/project/index.ts",
14-
"Resolving \\"./otherFile\\" from <cwd>/test/transpile/project",
14+
"Resolving \\"./otherFile\\" from <cwd>/test/transpile/project/index.ts",
1515
"Resolved ./otherFile to <cwd>/test/transpile/project/otherFile.ts",
1616
"Emitting output",
1717
"Emitting <cwd>/test/transpile/project/otherFile.lua",

0 commit comments

Comments
 (0)
X Tutup