Enabling Hot Module Reload in WebPack Aurelia CLI Project
While working on an Aurelia project migration to the Aurelia CLI, I found myself wondering how to make the Hot Module Reload works with Aurelia and Webpack.
This can sound pretty simple but after searching a bit around the internet, I didn't find anything. So I've started looking at the aurelia.json
file the CLI create. I wish I had checked that before!
Find out that there's a hmr
flag in that config. You only need to set it to true
and voilà! HMR started working out of the box without any further effort.
HMR allow you to see your changes live, without having to constantly wait for a full page reload when you're running au run --watch
command. This can save you tons of time. Less waiting, more code being done!