0

I looked at the help for init for the new Polymer CLI for but I could not see any flags to reduce the number of bower packages downloaded, especially if the init is for a new element, I would not really need paper-ripple by default or if I need it, I can add it later. Any ideas?

DocDude
  • 2,873
  • 1
  • 17
  • 15

1 Answers1

0

paper-ripple is a transitive dependency of iron-component-page, which is in the element template's default devDependencies. The iron-component-page is intended for the element's demo page, which would make sense if you were going to publish this element standalone.

The ElementGenerator simply copies files from its template directory, so you could just modify that directory in your installation, removing dependencies from bower.json as desired.

On my machine, I removed all dependencies from /usr/local/lib/node_modules/polymer-cli/lib/init/element/templates/bower.json so that it looks like this:

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

Now, the element generator outputs this:

$ 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.
tony19
  • 125,647
  • 18
  • 229
  • 307
  • You're not installing Polymer anymore, how are you running your element? – Justin Fagnani Jun 09 '16 at 17:41
  • The OP wants to manually install the deps as needed instead of with every new element generation. I can see a scenario where the element is intended to be used inside the current Polymer app, where Polymer is already installed. – tony19 Jun 09 '16 at 19:29