-
Notifications
You must be signed in to change notification settings - Fork 127
add service worker flag to build command #534
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that name changes away from sw-precache to more generic make sense if we don't actually support more generic service worker generation.
@@ -39,10 +39,19 @@ export class BuildCommand implements Command { | |||
'requests needed to serve your application.' | |||
}, | |||
{ | |||
name: 'sw-precache-config', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why rename this flag? The file is still sw-precache specific?
defaultValue: 'sw-precache-config.js', | ||
description: 'Path to an sw-precache configuration to be ' + | ||
'used for service worker generation.' | ||
name: 'add-service-worker', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
until we support more than sw-precache, we may want to name this something sw-precache specific. maybe --add-sw-precache
or --use-sw-precache
@justinfagnani the thinking was to not tie the service worker generation to the For the config filepath flag I could go either way. But given the |
I don't think we can uncouple the config from sw-precache because they have to know how to configure sw-precache from the config. The new flags docs even reference sw-precache docs. |
@justinfagnani renamed based on https://docs.google.com/document/d/1mD1cVhxdxY-bUsGBX44anC1875Afx7UHue4uRCNVc4o, PTAL |
bundled: options.bundle, | ||
}); | ||
if (options.addServiceWorker) { | ||
logger.debug(`Generating service worker...`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see this as a valuable logger.info
* Convert build to single build stream (#509) * Convert build to single build stream, add bundled flag * Clarify `--add-prefetch` build flag (#510) * rename confusing --insert-dependency-links flag to --prefetch-dependencies * rename prefetchDepedencies to addPrefetchLinks * rename to insert-prefetch-links * respond to review comments * Cleanup how optimize streams work, in preparation for babel stream (#524) * Cleanup how optimize streams work, in preparation for babel stream * death to lets * redeisn optimize interface * pull stream piping into a helper function * rollback cli dash-case naming * remove unused gulpif * update buildoptions to match planned polymer.json options * add babel to build stream, replace uglify with babili es2015 minifier (#525) * Cleanup how optimize streams work, in preparation for babel stream * add babel to build stream * death to lets * redeisn optimize interface * pull stream piping into a helper function * rollback cli dash-case naming * replace uglify with babili * fix bad merge conflict * fixup js-minify description * remove unused gulpif * update buildoptions to match planned polymer.json options * remove old comment * let to const * add service worker flag to build command (#534) * add service worker flag to build command * reword flags and descriptions * quick reword again * get rid of skiplibcheck * debug to info * Add support for polymer.json build configurations (#545) * Add support for named build permutations * respond to PR feedback * add comments on build function * update logging to be cleaner * update for new naming rules * update polymer-project-config to v1.2.0 * Update CHANGELOG.md * update polymer-build version, update shrinkwrap
(CHANGELOG will be updated when
new-build-flags
is merged into master).This PR adds a flag to the build command to generate a service worker. Like all the other new build flags this one is "default off" for now while we work towards the greater
polymer.json
build flags / build permutations story./cc @justinfagnani