Skip to content

Commit

Permalink
Correct Hot Module replacement description
Browse files Browse the repository at this point in the history
This fixes TypeStrong#902. It removes the dead example links and changes the wording to express that hot module replacement is not really supported by ts-loader.
  • Loading branch information
datenreisender authored Jul 8, 2019
1 parent 9854068 commit f483426
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,12 @@ It's worth noting that use of the `LoaderOptionsPlugin` is [only supposed to be
### Hot Module replacement
To enable `webpack-dev-server` HMR, you need to follow the official [webpack HMR guide](https://webpack.js.org/guides/hot-module-replacement/), then tweak a few config options for `ts-loader`. The required configuration is as follows:
We do not support HMR as we did not yet work out a reliable way how to set it up.
1. Set `transpileOnly` to `true` (see [transpileOnly](#transpileonly-boolean-defaultfalse) for config details and recommendations above).
2. Inside your HMR acceptance callback function, you must re-require the module that was replaced.
For a boilerplate HMR project using React, check out the [react-hot-boilerplate example](./examples/react-hot-boilerplate/).
If you want to give `webpack-dev-server` HMR a try, follow the official [webpack HMR guide](https://webpack.js.org/guides/hot-module-replacement/), then tweak a few config options for `ts-loader`:
For a minimal HMR TypeScript setup, go to the [hot-module-replacement example](./examples/hot-module-replacement/).
1. Set `transpileOnly` to `true` (see [transpileOnly](#transpileonly-boolean-defaultfalse) for config details and recommendations above).
2. Inside your HMR acceptance callback function, maybe re-require the module that was replaced.
## Contributing
Expand Down

0 comments on commit f483426

Please sign in to comment.