Skip to content
New issue

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

less 无法热更新 #321

Closed
xiangfengsu opened this issue Nov 25, 2016 · 5 comments
Closed

less 无法热更新 #321

xiangfengsu opened this issue Nov 25, 2016 · 5 comments

Comments

@xiangfengsu
Copy link

使用dva new 一个项目 为什么less文件 无法热更新?

@sorrycc
Copy link
Member

sorrycc commented Nov 25, 2016

是个问题,dva-cli 下个版本会改进。

@cnptu
Copy link

cnptu commented Dec 8, 2016

改个东西总是要手动刷新,很不方便

@xiangfengsu
Copy link
Author

xiangfengsu commented Dec 9, 2016

@cnptu 我目前的解决办法是修改 webpack.config.js

if (env === 'development') {
    webpackConfig.babel.plugins.push(new webpack.HotModuleReplacementPlugin());
    webpackConfig.devtool = '#eval';
    
    // webpackConfig.babel.plugins.push(['dva-hmr', {
    //   entries: [
    //     './src/index.js',
    //   ],
    // }]);

  }

npm install --save-dev webpack-hot-middleware

这个可以自动刷新,但不是热更新,修改文件后会刷新页面

@uwang
Copy link

uwang commented Dec 23, 2016

每次添加 ant 的新组件都要刷新下才可以显示样式,期待新版本的解决方案。

@sorrycc
Copy link
Member

sorrycc commented Dec 23, 2016

已解决,老用户参考这里升级下工具层,sorrycc/blog#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants