如何传递多个entry_points到pubspec.yaml中的聚合物变压器? [英] How do I pass multiple entry_points to polymer transformer in pubspec.yaml?

查看:122
本文介绍了如何传递多个entry_points到pubspec.yaml中的聚合物变压器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在 pub build 支持构建Polymer应用程序,如何将多个entry_points传递给pubspec.yaml文件中的Polymer变换器?



当我尝试用这种语法构建时,两个文件都有错误:

  transformers:
- polymer:
entry_points:web / reports.html,web / index.html


b $ b

当我尝试以下列方式传递它们时,只有最后一个入口点被构建:

  transformers:
- polymer:
entry_points:web / index.html
entry_points:web / reports.html
/ pre>

解决方案

YAML,序列是通过将方括号中的逗号分隔列表包装在 [0,1,2,] 因为你的例子看起来像这样:

 =lang-yaml prettyprint-override>  transformers:
- polymer:
entry_points:[web / index.html,web / reports.html]

或者:

  transformers:
- polymer:
entry_points:
- web / index.html
- web / reports.html


Now that pub build supports building Polymer apps, how do I pass multiple entry_points to the Polymer transformer in my pubspec.yaml file?

When I try to build with this syntax both files have errors:

transformers:
- polymer:
    entry_points: web/reports.html, web/index.html

And when I try passing them in the following manner, only the last listed entry point is built:

transformers:
- polymer:
    entry_points: web/index.html
    entry_points: web/reports.html

解决方案

In YAML, a sequence is created by wrapping a comma separated list in square brackets [ 0, 1, 2, ] or by putting each entry on a line by itself prepended by a hyphen - So your example would look like this:

transformers:
- polymer:
    entry_points: [ web/index.html, web/reports.html ]

Or this:

transformers:
- polymer:
    entry_points: 
      - web/index.html
      - web/reports.html

这篇关于如何传递多个entry_points到pubspec.yaml中的聚合物变压器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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