See the companion video here https://youtu.be/OwCSWVxDZGI
Simply said, the better you express your intent in your code, the easier it is for the compiler to optimize it. A simple example is using
const instead of
var, not chaining types of variables, or keeping complex structures relatively stable.
Note: Using Babel means that you might not see your original code in the browser debugger. Make sure to use SourceMaps and extensions
const city = address?.city;
var _address; const city = (_address = address) == null ? void 0 : _address.city;
Obviously, for any debugger it would be impossible to translate back to the original code without a table that translates between the output code of the compiler and the original code. So, you can ask the debugger to produce debug information and make it available.
Babel is widely used for Vue or React and lots of other occasions - so it is pretty likely you will find Babel in your tool stack. You can ask Babel to generate
SourceMaps you can ‘translate’ errors into your original source code
Note: Make sure you do not leak
SourceMaps into production! Too much information for any attacker.
npm run buildvs
npm run deploy), you might end up generating SourceMaps or not. If you cannot find a SourceMap, check that you do the right target.