LeslieMay / create-antd-react

用于构建一个利用react和antd搭建的后台项目
1 stars 0 forks source link

react 项目热加载 #1

Open 9188 opened 6 years ago

9188 commented 6 years ago

webpack配置优化(1)

可以试着配合 react-transform-hmr 或者 react-hot-loader 来实现热加载 如: react-transform-hmr $ cnpm i react-transform-hmr babel-plugin-react-transform --save-dev { "presets":["react","env"], "plugins": [ ["transform-decorators-legacy"], "transform-runtime", ["import",{"style": "css","libraryName": "antd"}] ], "env": { "development": { "plugins": [["react-transform", { "transforms": [{ "transform": "react-transform-hmr", "imports": ["react"], "locals": ["module"] }] }]] } } }