webpack打包后,在打开html页面,就报了如下的错误
.babelrc的配置如下:
{
"presets": [
"react",
"es2015",
"stage-0"
],
"env": {
"development": {
"plugins": [
[
"react-transform",
{
"transforms": [
{
"transform": "react-transform-hmr",
"imports": [
"react"
],
"locals": [
"module"
]
}
]
}
]
]
}
}
}
报错:
locals[0] does not appear to be a `module` object with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using `env` section in Babel configuration.
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
有人说更改这个 删除.bablerc文件的env ,但是不会改啊
.bablerc 不需要配置env把,直接删除试试看呢