Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Three ways to set up your webpack hot module replacement: webpack-dev-server CLI, webpack-dev-server API, and express with webpack-hot-middleware.

Notifications You must be signed in to change notification settings

andrewagain/webpack-hmr-3-ways

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HMR 3 Ways

There are 3 ways to use Webpack HMR. This repository contains a minimal example of each way. In order from simplest to most complex:

Here is a short discussion on how to pick the method you want to use.

About the Code

The browser javascript code within each directory is the same. There are 3 files:

js/index.js: Entry point. require()s the other 2 files, box-creator.js and math-doer.js.

js/math-doer.js: An extremely simple file to illustrate that dependencies are automatically updated by HMR.

js/box-creator.js: An example of a dependency that has side effects, with an example of how to use module.hot.dispose to handle such side effects.

About

Three ways to set up your webpack hot module replacement: webpack-dev-server CLI, webpack-dev-server API, and express with webpack-hot-middleware.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published