Well, obviously in dev we'd quite like to not have to hit refresh all the time, because developers are, well, we're lazy. So we can use a live reload server to do the job for us.
1 | yarn add --dev broccoli-livereload@^1.3.0 |
1 | // Brocfile.js |
What we're doing here is assigning the final output of Merge
to a mutable variable tree
, then passing that into the
LiveReload
plugin, that will auto-inject the Live Reload javascript and setup the server file watcher.
Now yarn serve
, try changing a scss
file, notice how the css refreshes in place, no browser refresh. Change a
.js
or .html
file and the page will refresh. This doesn't support fancy hot reloading like React and Webpack does,
but that's a slightly different ballgame, and is very architecture dependent.
Completed Branch: 08-live-reload
Next: 09-debug