Closed
Description
Hi from ng-conf! :)
TS nightly.
alexeagle-macbookpro2:repro_sourceMap alexeagle$ cat some/path/to/src/myfile.ts
export let a:string;
alexeagle-macbookpro2:repro_sourceMap alexeagle$ cat some/path/to/src/tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": false,
"sourceMap": true,
"inlineSources": true,
"outDir": "../../../../dist"
},
"exclude": [
"node_modules"
]
}
$ cat dist/myfile.js.map
{"version":3,"file":"myfile.js","sourceRoot":"","sources":["../some/path/to/src/myfile.ts"],"names":[],"mappings":";AAAoB","sourcesContent":["export let a:string;"]}
the sourceMap contains my private bits "some/path/to/" which we would like it not to.
This causes devTools in the browser to show a strange path that confuses users.
The obvious way to fix this would be the sourceRoot
option in tsconfig.json
which we could set to ..
but this is not allowed:
error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSources'.
Proposal is that sourceRoot should be allowed with inlineSources. The resulting .js.map
file would contain a path that doesn't resolve locally on disk, but does work at runtime. (it's similar to the pathMapping feature where design-time filesystem layout does not need to match runtime)
cc @IgorMinar