From the docs:
--inlineSourceMap and inlineSources command line options: --inlineSourceMap causes source map files to be written inline in the generated .js files instead of in a independent .js.map file. --inlineSources allows for additionally inlining the source .ts file into the .js file.
Does this mean the full file sources are written to the outputFile? Why would you want to do this? You can use the sourcemaps to reconstruct the original sources again anyway.
Apparently, typescript sourcemaps' default behavior is to redirect the dev tools to the original source files, instead of including them into the sourcemaps.
This means that without inlineSourceMap: true
, you are required to serve the original .ts files along with your bundled code.
Setting inlineSourceMap: true
changes this default behavior to what I would've expected typescript to do out of the box: include the source info into the sourcemaps. This way, you don't need to serve the original source files along with the app bundle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With