© Mohamed Bouzid 2020
M. BouzidWebpack for Beginnershttps://doi.org/10.1007/978-1-4842-5896-5_6

6. Webpack DevServer

Mohamed Bouzid1 
(1)
NA, Morocco
 

Now it’s time to talk about the webpack development server, which is mostly referred to as webpack-dev-server. We will explore the basic options and see how it will save us compilation time and give us a nice URL to work with. We will also learn about HMR (Hot Module Replacement), which will help us update our page without a full reload.

Installing and Configuring Webpack Dev Server

So far, we have used the command “npm run build repeatedly in order to bundle our code. Then to view the changes, we open the index.html file in the browser manually after locating that file first in our machine. In addition ...

Get Webpack for Beginners: Your Step-by-Step Guide to Learning Webpack 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.