Skip to content

Commit

Permalink
tsb should handle .js suffix (#227544)
Browse files Browse the repository at this point in the history
fixes #227540
  • Loading branch information
jrieken authored Sep 4, 2024
1 parent 638bcef commit e1cc3fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion build/lib/tsb/builder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion build/lib/tsb/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ class LanguageServiceHost implements ts.LanguageServiceHost {

while (!found && dirname.indexOf(stopDirname) === 0) {
dirname = path.dirname(dirname);
const resolvedPath = path.resolve(dirname, ref.fileName);
let resolvedPath = path.resolve(dirname, ref.fileName);
if (resolvedPath.endsWith('.js')) {
resolvedPath = resolvedPath.slice(0, -3);
}
const normalizedPath = normalize(resolvedPath);

if (this.getScriptSnapshot(normalizedPath + '.ts')) {
Expand Down

0 comments on commit e1cc3fa

Please sign in to comment.