I'm working on a project involving multiple layers of code transformation, and I'm trying to understand how source map generation works in such a complex setup. Our project uses TypeScript, and on top of that, we apply a series of transformations including Hermes for bytecode conversion, a minifier-obfuscator, and various utilities for tasks like log cleaning. Each of these layers affects the final bundle.js file.
My primary concern is about the generation and the accuracy of source maps through these sequential transformations. Specifically, I'm looking to understand:
How does source map generation work when the code undergoes multiple transformations? Is there a standard process that ensures the mapping remains accurate through each stage (TypeScript compilation, Hermes bytecode conversion, obfuscation, etc.)?
If each transformation layer potentially generates its own source map, how can I effectively backtrack to the original TypeScript code? Is there a way to merge or chain these source maps so that debugging reflects the original source accurately?
Thank you for your time and help!