HMR when using the windows filesystem in WSL2
I was having trouble with windows using WSL2 and hot module reloading, my code would not update upon changes. This was solved through making webpack poll by changing the dev command to:
yarn rw dev --forward="--watch --watch-poll=1000"
It would be good to add this to the config TOML file, if anyone knows the syntax, let me know
However, I suggest moving to using the Linux filesystem
Moving my files to ~/
then using explorer.exe .
to access the filesystem from explorer (when in WSL) sped up yarn rw dev
command at least 10X and mean’t I didn’t need to forward --watch-
poll` in the command.
Further info:
https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/
https://docs.microsoft.com/en-us/windows/wsl/compare-versions