DEV Community

Discussion on: Bazel can write to the source folder!

Collapse
 
sethbro profile image
Seth Bro • Edited

I created a dev.to account just so I could offer my thanks.

I've been trying for weeks to get a webpack dev server with hot module reloading (HMR) running through Bazel (currently have to restart the bazel process for every change).

I'd finally decided to just write a shell script to brute force copy files from the bazel output. This solution (while the same at heart :-)), is much more elegant & allows me to stay within the Bazel system.

Thank you so much! Will be sharing this solution with the Bazel JS/TS community.

Collapse
 
sethbro profile image
Seth Bro

Sorry—just realized you're responsible for much of the bazelbuild/rules_nodejs doc/commentary I've been poring over!

This pattern is directly applicable to a number of HMR-related Issues on that repo. It's a workaround certainly, but I have it operating with Webpack 5 & it's the first solution that's unblocked me. I've no doubt it would help others.

I'll add comments to those issues & strive to add an /examples/ PR, though not sure if this would be a sanctioned solution.