• YourAvgMortal@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    Usually when code is minified, it is shipped alongside a sourcemap (*.js.map), which can be used by the browser to show you the original code.

    If you get an error in the browser, you can click the error, which will take you to the network(?) tab and show you exactly where the error occurred

    • SokathHisEyesOpen@lemmy.ml
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      Also when code has been compiled, or transpiled. The reason the line numbers don’t match is because all of the code is being assembled into one large package and served to whatever client uses it. So even if you don’t minify, but you’re compiling, sourcemaps will show you where the error actually occurs, instead of where it occurs in the finished product.

      • Natanael@slrpnk.net
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Especially if the compiler optimization options inlined code from 5 different places into one blob