gaearon / gaearon/react-hot-loader
react-hot-loader breaks the page without react
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 775
- PR merge metrics
- No merged PRs in 30d
Description
### Description
My project has a lot of pages, some of which don't use react, react-hot-loader breaks these pages.
### Expected behavior
no react-hot-loader code in the js of the page.
### Actual behavior


i add react in webpack externals, but do not add cdn link in this page. and react-hot-loader requires it, so "React is not defined", but i really don't need react. If i remove react-hot-loader/babel in .babelrc or remove react in externals or add cdn link in this page, everything will be ok.
### Environment
React Hot Loader version: 4.2.0
Run these commands in the project folder and fill in their results:
1. `node -v`: 8.11.3
2. `npm -v`: 6.4.0
### Reproducible Demo
.babelrc
``` json
{
"presets": [
[
"env",
{
"targets": {
"node": "current",
"browsers": ["Android >= 4", "iOS >= 8", "last 3 versions"]
}
}
],
"react"
],
"plugins": [
"transform-object-assign",
"react-hot-loader/babel",
"transform-class-properties",
[
"transform-runtime",
{
"polyfill": false,
"regenerator": true
}
]
]
}
```
webpack externals
``` javascripts
externals: {
vue: 'Vue',
react: 'React',
'react-dom': 'ReactDOM',
'prop-types': 'PropTypes',
}
```
Contributor guide
Assessment
This issue has not been assessed yet.