如何传递多个entry_points到pubspec.yaml中的聚合物变压器? [英] How do I pass multiple entry_points to polymer transformer in pubspec.yaml?
问题描述
现在 pub build
支持构建Polymer应用程序,如何将多个entry_points传递给pubspec.yaml文件中的Polymer变换器?
当我尝试用这种语法构建时,两个文件都有错误:
transformers:
- polymer:
entry_points:web / reports.html,web / index.html
b $ b
当我尝试以下列方式传递它们时,只有最后一个入口点被构建:
transformers:
/ pre>
- polymer:
entry_points:web / index.html
entry_points:web / reports.html
解决方案在 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屋!