Adding a reload capability reduces the amount of time spent manually reloading our pages after a code change; the latter can be a real pain, especially when working with complex CSS styles!
The downside to this is that it only works in Chrome—if this isn't an issue, then these are the steps you would need to follow to make this work:
We'll start by extracting copies of the
gulpfile.js
andpackage.json
files from theT53 – adding livereload capabilities
folder, from the code download that accompanies this book. Save both copies to the root of our project area.From the same
T53 – adding livereload capabilities
folder, extract and save a copy of thestyle.css
file from thesrc
folder within, to thesrc
folder at the root of our project area.Fire up a Node.js command prompt, then change the working folder to our project area.
In the prompt, enter
npm install gulp-livereload –save-dev
and press Enter—let this install.