I am using the outFile
option in the tsconfig.json
to compile my typescript files into one .js file.
I am generating a source map.
Error messages are not referenced to the typescript file though.
Examples:
script.ts: throw 'Error'
tsconfig.json:
{
"compilerOptions": {
"sourceMap": true
}
}
Compiling (tsc 1.6.2) will generate:
script.js: throw 'Error
script.js.map: {"version":3,"file":"script.js","sourceRoot":"","sources":["script.ts"],"names":[],"mappings":"AACA,MAAM,QAAQ,CAAC"}
The browser's console (Chrome 47.0.2526.73 m) will display: Uncaught Error. script.ts:1
That's just fine.
script.ts: throw 'Error'
tsconfig.json:
{
"compilerOptions": {
"sourceMap": true,
"outFile": "app.js"
}
}
Compiling (tsc 1.6.2) will generate:
app.js: throw 'Error
app.js.map: {"version":3,"file":"app.js","sourceRoot":"","sources":["script.ts"],"names":[],"mappings":"AACA,MAAM,QAAQ,CAAC"}
The browser's console (Chrome 47.0.2526.73 m) will display: Uncaught Error. app.js:1
It is app.js it should be app.ts
How can I get the browser to reference error messages to my typescript files?