跑镖的WebApp Apache服务器上 [英] Run Dart WebApp on Apache Server

查看:193
本文介绍了跑镖的WebApp Apache服务器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想服务器Apache服务器上的应用程序飞镖。我说行

I want to server a Dart application on an Apache server. I added the line

application/dart dart

要在Apache配置的mime.type文件。尽管如此,我得到的错误

to the mime.type file in the Apache configuration. Still I get the error

Resource interpreted as Script but transferred with MIME type text/plain:    "http://localhost/~d022051/mastermind/web/mm-game.dart".

的另一个问题是链接到软件包的目录。我不想在服务器的文档目录的符号链接。是否有正确的版本复制所需的软件包一个聪明的方式?

Another issue is the link to the packages directory. I do not want to have symlinks in the documents directory of the server. Is there a smart way to copy the required packages in the correct version?

推荐答案

此消息无关与Apache。

This message has nothing to do with Apache.

这是一个,而我与Apache的工作,但据我知道你并不需要特定的设置使用Apache服务于飞镖客户端应用程序。他们就像任何其他静态HTML,CSS,JavaScript或图像文件。

It's a while that I worked with Apache, but as far as I know you don't need specific settings to serve a Dart client app using Apache. They are just like any other static HTML, CSS, JavaScript, or image files.

您得到这个消息,因为入口页面(index.html的)包含了飞镖脚本的脚本标记。运行后酒吧构建有生成输出没有飞镖脚本(还)(当Chrome支持达特这将改变和酒吧构建也产生飞镖输出)。

You get this message because the entry page (index.html) contains a script tag for a Dart script. After you run pub build there are no Dart scripts (yet) in the build output (this will change when Chrome supports Dart and pub build also generates Dart output).

在浏览器认为这(目前冗余)飞镖脚本标记它产生此输出。当你想摆脱这个消息只是删除从HTML页面的脚本标签在 your_app_package /建设/网页/ index.html的文件。

When the browser finds this (currently redundant) Dart script tag it produces this output. When you want to get rid of this message just remove the script tag from the HTML page in your your_app_package/build/web/index.html file.

修改

transformers:
- $dart2js:
    'minify': true
    commandLineOptions: ['--output-type=dart']

    commandLineOptions: ['--output-type=dart', '--categories=Server']

如果这个类的说法有效果我没有测试过 dart2dart 了。

I haven't tested if this categories argument has an effect in dart2dart too.

编辑结束

EDIT2

还有一个输出型镖的多它创建每个输入库中的一个输出文件。
请参见 HTTPS://$c$c.google。 COM / p /飞镖/问题/细节?ID = 21616#C9 了解更多详情。

There is also the output type dart-multi which creates one output file per input library. See https://code.google.com/p/dart/issues/detail?id=21616#c9 for more details.

EDIT2 END

这篇关于跑镖的WebApp Apache服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆