We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.babelrc
{ "presets": [ [ "@babel/preset-env", { "modules": "cjs", "useBuiltIns": "usage", "corejs": 3, "targets": { "ie": 11 } } ], "@babel/preset-react" ], "plugins": [ [ "dva-hmr" ], [ "add-module-exports", { "addDefaultProperty": true } ], //识别class组件 [ "@babel/plugin-proposal-class-properties", { "loose": true } ], [ "@babel/plugin-transform-runtime", { // corejs: 3 also supports instance properties (e.g. [].includes) // https://babeljs.io/docs/en/next/babel-plugin-transform-runtime.html#corejs "corejs": { "version": 3, "proposals": true }, // 保留ESModules,交给preset-env去处理modules "useESModules": true } ], //支持import 懒加载 [ "@babel/plugin-syntax-dynamic-import" ], //antd按需加载 true是less,如果不用less style的值可以写'css' [ "import", { "libraryName": "antd", "libraryDirectory": "lib", "style": true }, "ant" ], ] }
devServer: { hot: true, overlay: true, host: CONFIG.host, stats: "errors-only", disableHostCheck: true, historyApiFallback: true, port: CONFIG.port || 8000, contentBase: CONFIG.output, },
"dva": "^1.1.0", "@babel/core": "^7.5.5", "babel-loader": "^8.0.6", "babel-plugin-dva-hmr": "^0.4.2", "webpack": "^4.39.3",
dva
安装的依赖同npm插件页介绍一样
npm
npm install babel-plugin-dva-hmr redbox-react@1.x --save-dev
@sorrycc 大佬有时间帮忙看看,谢谢您!
The text was updated successfully, but these errors were encountered:
请问解决了吗?
Sorry, something went wrong.
没有噢 @caihaihong cai
@tylerrrkd @caihaihong
I found a solution for Webpack 5 and Babel 7, here is the detail:
hotOnly
true
// webpack.config.js devServer: { hotOnly: true, },
require
import
import router from './router'; app.router(router)
Hope it helps.
No branches or pull requests
.babelrc
配置如下webpack.config.js
版本信息
附
dva
版本不敢随意乱动安装的依赖同
npm
插件页介绍一样npm install babel-plugin-dva-hmr redbox-react@1.x --save-dev
@sorrycc 大佬有时间帮忙看看,谢谢您!
The text was updated successfully, but these errors were encountered: