从Dart2js输出创建Javascript部署集 [英] Creating a Javascript deployment set from Dart2js output

查看:586
本文介绍了从Dart2js输出创建Javascript部署集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发基于Dart的web应用程序的alpha版本之后,我有兴趣测试我的应用程序的Dart2js部署潜力。然而,它似乎没有一个干净的方式来创建一个JS部署版本的应用程序 - dart2js代码输出东西到out目录,但还有其他Dart的东西在那里。看来事情引用回到web父目录,然后有所有的包引用。我想把所有的东西复制到一个单独的目录,但是这似乎不工作。

After developing an alpha version of a Dart-based web application, I'm interested in testing the Dart2js deployment potentials of my app. However, it doesn't seem there is a "clean" way of creating a JS deployment version of the app - the dart2js code outputs stuff to the out directory, but there is other Dart stuff in there too. It seems things reference back to the web parent directory, and then there are all the packages references. I thought of copying all the stuff in out to a separate directory, but that doesn't seem to work.

有一个干净的方式来创建一个部署的Javascript Dart应用程式版本?

Is there a clean way to create a deployment of the Javascript version of a Dart app?

提前感谢,

-D

推荐答案

这是生活在流血边缘的喜悦之一...

This is one of the joy's of living on the bleeding edge...

answer:可能是dart上的pubspec的部署策略

要在网络ui项目上跟踪的另一个问题是:

Another issue to track on the web ui project is:

  • path fixing for resources (css, etc) breaks deployment

(基本上,您正在等待创建 pub deploy 命令)

(Basically, you're waiting for the pub deploy command to be created)

更新 Dartbug 6006 目前正在处理,并说它的工作方式如下:

Update: Dartbug 6006 is being worked on at the moment, and says that it work like the following:


它会将web中的所有内容复制到deploy目录中,在所有入口点上运行dart2dart和dart2js,并清理Dart源文件。这将产生一个目录,无需任何其他步骤即可投放。

It'll copy everything in "web" into a deploy directory, run dart2dart and dart2js on all the entrypoints, and clean up the Dart source files. This will produce a directory that can be served without any additional steps.

这篇关于从Dart2js输出创建Javascript部署集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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