在IntelliJ中,有一个标签为“Pub Serve”的标签,当我按Ctrl + Shift + R时,我可以在Pub Serve输出终端上看到大量输出,并启动Dart Editor附带的Chromium,显示我的Web应用程序。
现在,如果我对任何dart文件或html文件甚至index.html进行了更改,并在Chromium中刷新,则在单击Pub Serve上的“停止”按钮之前,看不到更改。
我已经在Chromium中安装了JetBrains插件,以查看它是否有所作为,无论如何。
从命令行运行pub serve的功能完全相同,直到您杀死它并重新运行pub serve为止,所做的更改才变得可见。
关于如何在代码更改后自动重新加载pub的任何想法?
更新:
我认为这可能与以下内容有关:https://code.google.com/p/dart/issues/detail?id=21402
最佳答案
看来问题是由安全写入引起的,有一个临时解决方法:
WEB-13739 Pub Serve on Mac OS doesn't notice that file contents changed, so refresh in browser shows old cached contents In DartEditor you can work like this:
Start debug (this will start pub serve which takes a while).
Edit template in polymer element
Save (Now DartEditor does something to recompile the polymer template, AFAIK it does not do a full restart of pub serve because it is faster).
Refresh browser, you see the change in the template.
But in Webstorm 9 EAP October 8 version, this workflow is not possible. I have to kill pub serve and restart in order to see my change in the polymer component's template. I would like Webstorm to work the same as DartEdtior so I can have the same save/refresh development cycle.
Workaround: uncheck 'safe write' mode in Preferences | Appearance & Behavior | System Settings and vote for the corresponding issue in the Google issue tracker.
此解决方法也与IntelliJ Ultimate有关。
在这里投票修复错误:
https://code.google.com/p/dart/issues/detail?id=21402
更新
错误已修复:
This should be working now. The underlying issue was in the watcher package, fixed here:
https://codereview.chromium.org/861313006/
Then pulled into the repo for pub and tested here:
https://codereview.chromium.org/801943005/ https://codereview.chromium.org/870703003/
谢谢鲍勃!
关于intellij-idea - 除非重新启动,否则发布服务不会更新Web,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27887085/