googlearchive / workbox-microsite

Workbox Microsite
Apache License 2.0
24 stars 13 forks source link

Tell me more about this "configuration" file #111

Open johnnyreilly opened 6 years ago

johnnyreilly commented 6 years ago

Hi,

I've been reading and re-reading this part of the docs and I'm a little confused:

  1. Create a configuration file telling Workbox which resources to cache.
  2. Run one of the Workbox tools in your project directory before each deploy. Workbox generates the service worker code needed for caching and updating the resources.

There doesn't seem to be reference anywhere else in the docs as to what this config file is and how to create it. Or perhaps there is and I'm just being a bit dim. (Entirely possible!)

Either way, it might be good to be a little more explicit here in the docs as to what you mean. Perhaps a link how you could create this config file?

Also, am I right in thinking that, if said config file exists, workbox will just pick it up and use it by convention? It looks for a file with a particular name and if it finds it, it uses it?

In case it's relevant I'm using the webpack plugin to generate my service worker and I'm looking with interest at this talk of a configuration file, imagining it might allow me to have more control over the strategies I might want to use.

Thanks for all your work! I really like the potential workbox has to make PWAs more straightforward. I'm open to submitting docs PRs if that's helpful BTW?

johnnyreilly commented 6 years ago

https://workboxjs.org/overview.html#how-you-use-workbox

johnnyreilly commented 6 years ago

So I think that this documents the options that can be supplied to the workbox-webpack-plugin are these:

https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.Configuration

Is that right?

BTW it looks like workboxjs.org has been retired in place of https://developers.google.com/web/tools/workbox/ . (Probably related to #108) Is that intentional?