From microsoft/vscode#54026
//tsconfig.json
{
"compilerOptions": {
"sourceMap": true,
"sourceRoot": "src/",
"mapRoot": "build/"
}
}
./src/hello.ts exists
Actual
I run tsc and get:
hello.js:
console.log("hello world!");
//# sourceMappingURL=/Users/roblou/Downloads/tsTest/build/hello.js.map
hello.map.js:
{"version":3,"file":"hello.js","sourceRoot":"/Users/roblou/Downloads/tsTest/src/","sources":["hello.ts"], ...
Expected
This stuff is not clearly spec'd but my understanding is that sourceMappingURL and sourceRoot should be URIs or relative paths, not local absolute paths. In a browser, a path starting with / should be interpreted as relative to the webserver root.
In Node, Chrome Devtools handles this on Mac, but on Windows, it can't handle a sourceMappingUrl or sourceRoot as a windows-style absolute path. That is what convinces me that this is worth fixing on TS's end.
In vscode, I plan to try to support this scenario somehow, since it previously worked.
From microsoft/vscode#54026
./src/hello.tsexistsActual
I run
tscand get:hello.js:
hello.map.js:
Expected
This stuff is not clearly spec'd but my understanding is that sourceMappingURL and sourceRoot should be URIs or relative paths, not local absolute paths. In a browser, a path starting with / should be interpreted as relative to the webserver root.
In Node, Chrome Devtools handles this on Mac, but on Windows, it can't handle a sourceMappingUrl or sourceRoot as a windows-style absolute path. That is what convinces me that this is worth fixing on TS's end.
In vscode, I plan to try to support this scenario somehow, since it previously worked.