Use the webpack dev server to build and serve assets with or without hot replacement.
$ npm run dev-server
$ npm run hot-dev-server
When using the dev-server
command, any changes to asset files will force a
page refresh.
When using the hot-dev-server
command, any changes to asset files will force
a hot module replacement, updating page content without refreshing the page or
changing the current state.
Use webpack to build your assets.
$ npm run build
Use express to serve requests. Depending on whether a dev or production build, the asset resource is either loaded from express's static dir (production) or from webpack dev server (development).
$ npm run serve