HMR w/ webpack-dev-server CLI
This project shows the simplest way to use Webpack HMR, which is with webpack-dev-server CLI
npm start command runs:
webpack-dev-server --content-base=www --inline --watch --hot.
Let's discuss each argument:
--content-base: Serve whatever content is in the
www/ directory. This is in addition to
--inline: This adds the 'webpack-dev-server client entry point' to your application. This means
webpack-dev-server will serve HMR updates. The bottom line is that you need it in order to use HMR.
--hot: The reason we are here! Enables hot module replacement.