pub serve 不更新 web 除非我重新启动它

pub serve not updating web unless I restart it

在 IntelliJ 中有一个显示 "Pub Serve" 的选项卡,当我按下 Ctrl + Shift + R 时,我可以在 Pub Serve 输出终端上看到大量输出,它启动了 Dart 编辑器附带的 Chromium显示我的网络应用程序。

现在,如果我更改任何 dart 文件或 html 文件甚至 index.html 并在 Chromium 中刷新,在单击停止按钮之前我看不到更改酒吧服务。

我已经在 Chromium 中安装了 JetBrains 插件,看看它是否有所作为,一点也没有。

运行 命令行的 pub serve 完全相同,直到你杀死它并重新 运行 pub serve,你的更改才可见。

知道如何让发布服务在代码更改时自动重新加载吗?

更新:

我认为这可能是相关的: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:

  1. Start debug (this will start pub serve which takes a while).

  2. Edit template in polymer element

  3. 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).

  4. 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.

https://youtrack.jetbrains.com/issue/WEB-13739

此解决方法也与 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/

谢谢鲍勃!