初始化聚合物 cli 的标志?

Flag for init polymer cli?

我查看了 helpinit 和新的 Polymer CLI 的但是我看不到任何标志来减少下载的 bower 包的数量,特别是如果 init 是一个新元素,默认情况下我真的不需要 paper-ripple 或者如果我需要它,我可以稍后添加它。 有什么想法吗?

paper-rippleiron-component-page的传递依赖,在element template's default devDependencies中。 iron-component-page 用于元素的演示页面,如果您打算独立发布此元素,这将很有意义。

ElementGenerator 只是 copies files from its template directory,因此您可以在安装中修改该目录,根据需要从 bower.json 中删除依赖项。

在我的机器上,我从 /usr/local/lib/node_modules/polymer-cli/lib/init/element/templates/bower.json 中删除了所有依赖项,因此它看起来像这样:

{
  "name": "<%= name %>",
<% if (description) { -%>  "description": "<%= description %>",
<% } -%>
  "main": "<%= name %>.html"
}

现在,元素生成器输出如下:

$ polymer init element
info:    Running template element
? Element name x-bar
? Brief description of the element
   create bower.json
   create demo/index.html
   create index.html
   create README.md
   create x-bar.html
   create test/x-bar_test.html

Project generated!
Installing dependencies...


I'm all done. Running bower install for you to install the required dependencies. If this fails, try running the command yourself.



Setup Complete!
Check out your new project README for information about what to do next.