HomePhabricator
Diffusion Comm 2a3d2928af84

[keyserver] Add `--source-maps` flag to `babel-build` for more sane debugging…

Description

[keyserver] Add --source-maps flag to babel-build for more sane debugging experience

Summary:
We previously weren't generating source maps when running babel-build in dev.

This led to a pretty painful debugging experience for keyserver in VSCode/WebStorm/etc. If the developer wanted to set breakpoints they'd need to

  1. Navigate out of the src file to the corresponding file in dist (tedious/context switch/etc)
  2. Set breakpoints in transpiled output which often looked pretty different from source

In addition, the developer would need to keep hopping between the files because dist got rewritten on changes to src which meant the developer couldn't just iterate within dist either.

This diff adds the --source-maps flag to babel-build for dev which enables a much smoother debugging experience. Breakpoints can be set directly in source and iteration can happen in realtime.

I should have investigated this much much earlier...

Test Plan:
Worked in VSCode and WebStorm out of the box:

Screen Shot 2022-08-30 at 2.40.47 PM.png (1×3 px, 883 KB)

Screen Shot 2022-08-30 at 2.43.52 PM.png (1×3 px, 935 KB)

Reviewers: abosh, jacek, tomek, jon

Reviewed By: abosh, tomek, jon

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D4984