diff --git a/build/lib/tsb/builder.js b/build/lib/tsb/builder.js index fc74bfa8acc63..e097b91a3ea0a 100644 --- a/build/lib/tsb/builder.js +++ b/build/lib/tsb/builder.js @@ -550,7 +550,10 @@ class LanguageServiceHost { let found = false; 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')) { this._dependencies.inertEdge(filename, normalizedPath + '.ts'); diff --git a/build/lib/tsb/builder.ts b/build/lib/tsb/builder.ts index 9fc476ae7020b..8aa277a8a822f 100644 --- a/build/lib/tsb/builder.ts +++ b/build/lib/tsb/builder.ts @@ -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')) {