intellij-idea - 除非重新启动,否则发布服务不会更新Web

标签 intellij-idea dart dart-pub

在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:

  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/



谢谢鲍勃!

关于intellij-idea - 除非重新启动,否则发布服务不会更新Web,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27887085/

相关文章:

dart - 是否可以转换已编译的 javascript,并配置运行转换器的顺序?

java - 重新运行 Spring Boot 配置注释处理器以更新生成的元数据

java - Intellij maven模块继承

intellij-idea - Intellij 的本地历史可以追溯到多远?

testing - 尝试测试 html 文件对象时,它不会让我用示例图像预填充它吗?

flutter - 在 Flutter 中使用动画将项目从一个列表移动到另一个列表

dart - Dart中的多维数组[列表]

dart - webcomponents.js 失败并出现错误 404

java - Intellij 想法,Git : Revert commit mechanism not working

flutter - 如何使用Flutter将2个 float 操作按钮固定在某些特定位置?