

Don’t worry if you don’t observe a bundle.js in your file system after triggering these scripts. One extra tidbit, when WDS bundles up the JS files, it serves it from memory. The - hot option enables Hot Module Replacement. The last 3 scripts just open the main page using the specified browser. Last but not least I added the following scripts to my package.json.
#WEBPACK LIVERELOAD BROWSER INSTALL#
At the end of the article I have my entire final file in one shot, should you wish to copy it.įirst install necessary packages if you don’t already have them using npm or yarn npm install -save-dev nodemon webpack-dev-server webpack-cliīefore I started my output property was set to as follows: output: , Here are the changes I had to make to my & package.json file. For those two things combined, WDS will achieve my goals. Additionally I wanted my bundle to be rebuilt and my browser to also refresh when the bundle is ready. I decided that having a backend refresh automatically with each code save using nodemon would be ideal so I could implement a RESTful API. I’m in the middle of a rapid development of a full-stack javascript single page application (SPA). The only downside to this configuration is I cannot use socket.io to communicate between nodemon’s server and WDS’s client.

Additionally at the time of this article webpack-livereload-plugin is not compatible with webpack 4 that was just released a few days ago. Last week I did the research and today I’m sharing for posterity’s sake. Now again, I find myself in need of a tool to speed up development time. I failed miserably, and moved on instead of wasting time on the project. Click here to share this article on LinkedIn »Ī couple of weeks ago, when I was under the pressure of time, I decided to attempt to get webpack-dev-server (WDS) running. LiveReload While Laravel Mix ships with Browsersync support out of the box, you may prefer to use LiveReload.
