[英]dart2js and dart2dart on build
I am trying to build but I have this situation 我正在尝试建造,但我有这种情况
bin
are server files and don't need to be compiled to js. bin
中的文件是服务器文件,不需要编译为js。 async/await
while client files don't. async/await
我们,而客户端文件没有。 The server is run with the --enable-async
VM option. --enable-async
VM选项运行。 Currently I include this in my pubspec.yaml 目前,我将其包含在我的pubspec.yaml中
- $dart2js:
$exclude: bin
because I get an error for using async
on the server. 因为我在服务器上使用
async
时遇到错误。 If I include the async_await
transformer I get even more errors (in fact I had to role back to using then
on the client). 如果包含
async_await
转换器, async_await
出现更多错误(实际上,我不得不回到客户端上使用then
角色)。
The real question is how to get efficient server and client dart files, and get efficient client js files out of the build process. 真正的问题是如何从构建过程中获取有效的服务器和客户端dart文件,以及获取有效的客户端js文件。
You can use snapshots for server side code. 您可以将快照用于服务器端代码。 This packs everything into one file and speeds up app startup.
它将所有内容打包到一个文件中,并加快了应用程序的启动速度。
See https://www.dartlang.org/articles/snapshots/ for more details. 有关更多详细信息,请参见https://www.dartlang.org/articles/snapshots/ 。
I don't have an answer for the other points. 对于其他问题,我没有答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.