Closed vdegenne closed 5 years ago
polymer-cli
is a kind of "swiss army knife" and should be suitable for typical projects (e. g. having fully static front end) based on polymer-starter-kit
polymer-build
is a more advanced library which allows to setup custom gulp
build process, to customize bundler strategies, to process sources and dependencies separately etc.
polymer-bundler
is a low-level tool, which should be used in complicated cases like this one you posted here.
There is a section regarding this subject in polymer-build
readme. The documentation could also contain more details about those differences, though.
My current feeling is that CLI is for newcomers, those guys sometimes not even aware of how to use gulp
(and that makes me sad). In our project, we've been using gulp-web-component-shards
for a while, until polymer-build
0.5 powered by the new analyzer finally landed.
/cc @katejeffreys for some feedback related to the docs issue
Marking this as closed. Would suggest if @vdegenne still has unanswered questions concerning the use of polymer-bundler, polymer-build or polymer-cli to reopen this issue and ask. Cheers!
A delayed thanks to @web-padawan for great answer to this issue.
That would be great if the tool were outputting exactly as
polymer build
does. I have this project where I don't usepolymer-cli
because my app is using Apache and php. I wanted to find an easy tool to bundle my Polymer elements into one file so I can reduce the number of requests with the clients. At first I found the only solution was to installpolymer-cli
and create apolymer.json
file and runpolymer build
. But it turns out the outputting files are bundled into a directory structure I can't customize, but the bundled file is neat, minimized, comments stripped, and so on. So I deep-searched if I was able to change the location where the bundled file will get saved, no luck. But I foundpolymer-bundler
and now I love how easy I can just type in my command line with the target and the--inline-x
options. But then the output file is so different with whatpolymer build
gave me.--inline-x
options won't inline or minimize anything in my files, comments with a@license
won't get stripped. Why are the tools giving such a different output ? because I readpolymer-bundler
is used internally in thepolymer-cli
program for the building process.