I'm struggling to figure out how to generate sourcemaps with Babel when using the command line. The Babel documentation seems to focus more on integrating with gulp, and it's not clear how to apply that knowledge to the command line.
Currently, I am compiling my TypeScript code like this:
tsc -p ./src
Here is a snippet from my tsconfig.json file:
{
"compilerOptions": {
"module": "amd",
"noImplicitAny": true,
"removeComments": false,
"preserveConstEnums": true,
"out": "wwwroot/app.js",
"sourceMap": true,
"target": "ES6"
},
"files": [
"App.ts"
]
}
This configuration generates both wwwroot/app.js and wwwroot/app.js.map files.
Afterwards, I run Babel over app.js using the following command:
babel ./wwwroot/app.js -o ./wwwroot/app.js --presets es2015 --compact false --inputSourceMap ./wwwroot/app.js.map --sourceMaps both
While this updates app.js, it leaves app.js.map untouched, causing them to no longer synchronize correctly.
Can anyone provide guidance on how to make the Babel step create a new sourcemap that accurately maps my final app.js back to the original TypeScript source?