Dva: windows 下 webstorm 的 webpack 监听问题

Created on 20 Oct 2016  ·  13Comments  ·  Source: dvajs/dva

大神,求教个问题。
我使用了dva new project,然后使用webstorm这个ide来开发,用npm start来启动项目,但是遇到个问题,每次修改css,html之类的文件后,这些文件好像并不能及时地更新,或者说不能自动更新,js文件貌似是可以自动更新的。这就导致每修改一点东西,我都必须ctrl+c停止服务,然后npm start启动项目,这个问题有解决办法么?

faq question

Most helpful comment

感觉和我遇到的问题一样。
Webpack watch not working on Webstorm on Windows?

seems Webpack watch doesn't work if the file is not saved directly. Please try turning 'Safe write' option ( Settings | Appearance & Behavior | System Settings | Use "safe write" (save changes to temporary file first)) off

All 13 comments

应该不不行重启 npm start 的,手动刷新页面没有用?

是啊,刷新页面不起作用,必须重启服务。
或者大神开发时使用的是什么ide?我试试看有没有这种情况。非常感谢!

@yipanbo 看看是不是 file watch 冲突了

nikogu也是大神。我并没有设置其他的东西,我觉得最好是dva new出来项目之后,不用再做其他的配置就可以支持这种热更新最好。也可能是webstorm这类ide引起的?这个只是我的猜测。

@yipanbo 你换个编辑器看看具体问题,如果不行就重启下电脑,有时候是系统的文件监听系统有点问题,有时候重启可以搞好

大神遇到过这种问题没?顺便我也想问问大神用的ide是啥,换个ide试试效果。

我用的webstorm,但是我没遇到类似的问题,你打开 首选项,搜一下,filewatch看看

感觉和编辑器无关吧。

上次有个案例是 idea 有冲突,还有一次是重启电脑就好了

我刚才看了webstorm的file watch,里面显示no file watchers configured,还需要配置这个么?

突然想到一点,我的操作系统是win10,项目在c盘,会不会跟win10系统有关,或者c盘的权限有关?

感觉和我遇到的问题一样。
Webpack watch not working on Webstorm on Windows?

seems Webpack watch doesn't work if the file is not saved directly. Please try turning 'Safe write' option ( Settings | Appearance & Behavior | System Settings | Use "safe write" (save changes to temporary file first)) off

@seamys 好像确实是你说的,晚上试一下,可以的话就可以结贴了,谢谢!

Was this page helpful?
0 / 5 - 0 ratings