简体   繁体   English

奇怪的DartEditor行为/错误?

[英]Weird DartEditor behavior / bug?

I'm working on a little website using dart. 我正在使用dart制作一个小型网站。 I have one project for the server, and another for the client app (see picture below) 我有一个用于服务器的项目,另一个用于客户端应用程序(请参见下图)

项目树

In the server app I serve the client app from the client project like this 在服务器应用程序中,我像这样从客户端项目提供客户端应用程序

runServer() {
  var staticHandler = createStaticHandler(r"C:\Users\Lukasz\dart\linkShepherdClient\web\", defaultDocument: 'linkShepherd.html',serveFilesOutsidePath: true);
  var handler = new Cascade()
                      .add(staticHandler)
                      .add(routes.handler)
                      .handler;
  io.serve(handler, InternetAddress.LOOPBACK_IP_V4, 8080).then((server) {
    print('Listening on port 8080');
  }).catchError((error) => print(error));   
}

Everything worked fine. 一切正常。 But now the changes I do in the client project stopped affecting the site served by the server (a site still loads, just an older version, with slightly different styling, but most importantly also an older .dart script file). 但是现在我在客户端项目中所做的更改不再影响服务器所服务的站点(站点仍在加载,只是旧版本,样式略有不同,但最重要的是还加载了较旧的.dart脚本文件)。 When I run the client directly from it's project everything is up to date. 当我直接从项目中运行客户端时,一切都是最新的。 Opening and closing the editor does not help. 打开和关闭编辑器无济于事。 Is the dart editor actually creating some sort of cache? 飞镖编辑器是否实际上在创建某种缓存?

The cache might be from dart:io . 缓存可能来自dart:io You should probably launch a pub serve instance and redirect to this during development anyway. 无论如何,您可能应该启动pub serve实例并重定向到该实例。 This way any transformers (Angular, Polymer, ...) are applied as well. 这样,任何变压器(角形,聚合物,...)也适用。 When deployed the server should serve the build output of the client. 部署后,服务器应为客户端的构建输出服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM