@@ -84562,6 +84562,15 @@ var ts;
8456284562 declFileName = paths.declarationFilePath || paths.jsFilePath || file.fileName;
8456384563 }
8456484564 if (declFileName) {
84565+ var specifier = ts.moduleSpecifiers.getModuleSpecifier(__assign(__assign({}, options), { baseUrl: options.baseUrl && ts.toPath(options.baseUrl, host.getCurrentDirectory(), host.getCanonicalFileName) }), currentSourceFile, ts.toPath(outputFilePath, host.getCurrentDirectory(), host.getCanonicalFileName), ts.toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName), host, host.getSourceFiles(),
84566+ /*preferences*/ undefined, host.redirectTargetsMap);
84567+ if (!ts.pathIsRelative(specifier)) {
84568+ // If some compiler option/symlink/whatever allows access to the file containing the ambient module declaration
84569+ // via a non-relative name, emit a type reference directive to that non-relative name, rather than
84570+ // a relative path to the declaration file
84571+ recordTypeReferenceDirectivesIfNecessary([specifier]);
84572+ return;
84573+ }
8456584574 var fileName = ts.getRelativePathToDirectoryOrUrl(outputFilePath, declFileName, host.getCurrentDirectory(), host.getCanonicalFileName,
8456684575 /*isAbsolutePathAnUrl*/ false);
8456784576 if (ts.startsWith(fileName, "./") && ts.hasExtension(fileName)) {
@@ -86614,6 +86623,7 @@ var ts;
8661486623 useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); },
8661586624 getProgramBuildInfo: ts.returnUndefined,
8661686625 getSourceFileFromReference: ts.returnUndefined,
86626+ redirectTargetsMap: ts.createMultiMap()
8661786627 };
8661886628 emitFiles(ts.notImplementedResolver, emitHost,
8661986629 /*targetSourceFile*/ undefined, ts.getTransformers(config.options, customTransformers));
@@ -92041,7 +92051,7 @@ var ts;
9204192051 return false;
9204292052 // Before falling back to the host
9204392053 return host.fileExists(f);
92044- } }, (host.directoryExists ? { directoryExists: function (f) { return host.directoryExists(f); } } : {})), { useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, getProgramBuildInfo: function () { return program.getProgramBuildInfo && program.getProgramBuildInfo(); }, getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); } });
92054+ } }, (host.directoryExists ? { directoryExists: function (f) { return host.directoryExists(f); } } : {})), { useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, getProgramBuildInfo: function () { return program.getProgramBuildInfo && program.getProgramBuildInfo(); }, getSourceFileFromReference: function (file, ref) { return program.getSourceFileFromReference(file, ref); }, redirectTargetsMap: redirectTargetsMap });
9204592055 }
9204692056 function emitBuildInfo(writeFileCallback) {
9204792057 ts.Debug.assert(!options.out && !options.outFile);
0 commit comments