-
Notifications
You must be signed in to change notification settings - Fork 792
Open
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:
node -v
: 8.11.3npm -v
: 6.4.0
Reproducible Demo
.babelrc
{
"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
externals: {
vue: 'Vue',
react: 'React',
'react-dom': 'ReactDOM',
'prop-types': 'PropTypes',
}
Metadata
Metadata
Assignees
Labels
No labels