Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Make all "polymer-cli build" features available without the CLI #2484

Open ronnyroeller opened 7 years ago

ronnyroeller commented 7 years ago

"polymer-cli build" provides great out-of-the-box functionality but so far we very quickly outgrow it for every project (e.g. inject the Git rev number, create localization files, build Cordova apps, etc.)

From the documentation, I understand that gulp + polymer-build is the way to go once polymer-cli becomes insufficient for the project's needs. Unfortunately, there is quite some nice functionality in polymer-cli (but not in polymer-build) that needs to be replicated - and maintained - when doing this step. For example: compile to ES5, minification, build presets, polymer.json config for those steps, etc.

Is this intentionally (e.g. is "polymer-cli build" intended only to spin up demo apps)? Is there already a way to reuse these polymer-cli features? Alternatively, is it possible (and advised) to inject our own build steps (like injecting Git rev number) in the "polymer-cli build" process? If so: is there any documentation on how to do this?

ronnyroeller commented 7 years ago

If somebody else runs into the same issue: We described & open sourced our build process for Polymer apps (and still hope to nuke it soon once this ticket gets implemented :wink: ): https://medium.com/collaborne-engineering/building-polymer-app-with-gulp-dee266d348df

web-padawan commented 7 years ago

Great work, our gulpfile includes mostly the same stuff, just not so structured. Regarding further additions, it's clear to me that for Polymer 2, we are going to need at least 3 build destinations for conditional serving:

The fact is that Polymer team only enforces us to use Service Workers and says nothing about cache busting, so I don't think they are inclined to implement the latter.

davidmaxwaterman commented 7 years ago

I'm also hitting the limitations of polymer-cli. I've been very reluctant to move into my own gulpfile since I've been there and it can be quite a 'time-pit' (I've moved back-and-forth a couple of times already)...but I really do want to be able force an update to files cached by the service worker, and add a version to my app's "about" UI. I'll take a look at @ronnyroeller's one - thanks for that!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.