Skip to content

Commit a9d92b0

Browse files
committed
React Hot Module Replacement docs.
1 parent 85fc019 commit a9d92b0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ React CSS Modules implement automatic mapping of CSS modules. Every CSS class is
2121
- [Options](#options)
2222
- [`allowMultiple`](#allowmultiple)
2323
- [`errorWhenNotFound`](#errorwhennotfound)
24-
[React Hot Module Replacement](#react-hot-module-replacement)
24+
- [React Hot Module Replacement](#react-hot-module-replacement)
2525
- [Class Composition](#class-composition)
2626
- [What Problems does Class Composition Solve?](#what-problems-does-class-composition-solve)
2727
- [Class Composition Using CSS Preprocessors](#class-composition-using-css-preprocessors)
@@ -369,13 +369,13 @@ Throws an error when `styleName` cannot be mapped to an existing CSS Module.
369369

370370
## React Hot Module Replacement
371371

372-
Hot module reloading does to reload the CSS (see https://github.com/gajus/react-css-modules/issues/51).
372+
[Hot module reloading](https://github.com/gaearon/react-transform-hmr) (HMR) does to reload the CSS document (see https://github.com/gajus/react-css-modules/issues/51). It only reloads the `class` HTML attribute value.
373373

374-
To enable CSS reloading, my advise is to wrap your webpack setup using [BrowserSync](https://www.browsersync.io/). BrowserSync enables CSS reloading when it detects a file change.
374+
To enable CSS reloading, wrap [`webpack-dev-server`](https://webpack.github.io/docs/webpack-dev-server.html) configuration using [BrowserSync](https://www.browsersync.io/). BrowserSync enables CSS reloading when it detects a file change.
375375

376-
[React CSS Modules examples](https://github.com/gajus/react-css-modules-examples) repository includes a configuration example using [BrowserSync](https://github.com/gajus/react-css-modules-examples/blob/master/webpack.config.browsersync.js).
376+
[React CSS Modules examples](https://github.com/gajus/react-css-modules-examples) repository includes a configuration example using [BrowserSync configuration using webpack-dev-server](https://github.com/gajus/react-css-modules-examples/blob/master/webpack.config.browsersync.js).
377377

378-
Note that `webpackk-dev-server` program [does not write bundle files to the disk](https://github.com/webpack/webpack-dev-server/issues/62). You need to use a [write-file-webpack-plugin](https://github.com/gajus/write-file-webpack-plugin) plugin to force writing to the disk to enable BrowserSync to detect changes.
378+
Note that `webpackk-dev-server` program [does not write bundle files to the disk](https://github.com/webpack/webpack-dev-server/issues/62). Use [write-file-webpack-plugin](https://github.com/gajus/write-file-webpack-plugin) plugin to force writing to the disk. This will enable BrowserSync to detect changes.
379379

380380
## Class Composition
381381

0 commit comments

Comments
 (0)