Skip to content

Commit 81e012f

Browse files
committed
dont canonicalize the filename when generating names, just use the absolute path
1 parent 951a77f commit 81e012f

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ namespace ts {
18911891
export function getExternalModuleNameFromPath(host: EmitHost, fileName: string): string {
18921892
const getCanonicalFileName = (f: string) => host.getCanonicalFileName(f);
18931893
const dir = toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName);
1894-
const filePath = toPath(fileName, host.getCurrentDirectory(), getCanonicalFileName);
1894+
const filePath = getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());
18951895
const relativePath = getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
18961896
return removeFileExtension(relativePath);
18971897
}

tests/baselines/reference/commonSourceDir5.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ export var pi = Math.PI;
1616
export var y = x * i;
1717

1818
//// [concat.js]
19-
define("b:/baz", ["require", "exports", "a:/bar", "a:/foo"], function (require, exports, bar_1, foo_1) {
19+
define("B:/baz", ["require", "exports", "A:/bar", "A:/foo"], function (require, exports, bar_1, foo_1) {
2020
"use strict";
2121
exports.pi = Math.PI;
2222
exports.y = bar_1.x * foo_1.i;
2323
});
24-
define("a:/foo", ["require", "exports", "b:/baz"], function (require, exports, baz_1) {
24+
define("A:/foo", ["require", "exports", "B:/baz"], function (require, exports, baz_1) {
2525
"use strict";
2626
exports.i = Math.sqrt(-1);
2727
exports.z = baz_1.pi * baz_1.pi;
2828
});
29-
define("a:/bar", ["require", "exports", "a:/foo"], function (require, exports, foo_2) {
29+
define("A:/bar", ["require", "exports", "A:/foo"], function (require, exports, foo_2) {
3030
"use strict";
3131
exports.x = foo_2.z + foo_2.z;
3232
});

tests/baselines/reference/getEmitOutputSingleFile2.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ declare class Foo {
2323
x: string;
2424
y: number;
2525
}
26-
declare module "inputfile3" {
26+
declare module "inputFile3" {
2727
export var foo: number;
2828
export var bar: string;
2929
}

0 commit comments

Comments
 (0)