August 2017
Beginner
298 pages
7h 4m
English
So far, we have created the Webpack configuration to compile our code, but it will be easier if we can serve the code as we did using http-server. webpack-dev-server is a small server written using Node.js and Express, which is used to serve the Webpack bundle. To use webpack-dev-server, we need to install it's dependencies and update our npm scripts:
npm install -D webpack-dev-server
Add the following line to the npm scripts:
"watch": "webpack-dev-server"
Using the npm run watch, we can now serve the files over a server on our localhost. webpack-dev-server does not write the bundled files to the disk. Instead, it will automatically serve them from memory. One great feature of webpack-dev-server is that it is able to ...
Read now
Unlock full access