$ npm install
$ ./node_modules/.bin/webpack-dev-server
$ open http://localhost:8080/webpack-dev-server/
Notes:
- Note the trailing slash on the URL is significant. Without it webpack-dev-server shows a file listing page.
- You need 1.0.11 or later of webpack-dev-middleware for this URL to work. With earlier versions you need to specify the full URL like this:
http://localhost:8080/webpack-dev-server/index.html
. - To get a non-autoreloading version of the page use
http://localhost:8080/index.html
.
There is a problem in my development.
webpack-dev-server serves files from publicPath of output of webpack configure. And html-webpack-plugin does not provide publicPath option, so server cannot find the html generated by the plugin on webpack-dev-server mode.
There is the console info of my webpack-dev-server running:
(js file has the publicPath, but html file does not. http://127.0.0.1:9999/dist/html/frontDesk.html cannot be found.)
http://127.0.0.1:9999/
webpack result is served from /dist/
content is served from ./
Hash: 579c06bbc3b1897ddc9e
Version: webpack 1.14.0
Asset Size Chunks Chunk Names
js/frontDesk.579c06bbc3b1897ddc9e.bundle.js 6.08 MB 0 [emitted] frontDesk
Users/jacobway/Projects/Front_End_Web/iKTV/dist/html/frontDesk.html 764 bytes [emitted]