Search code examples
progressive-web-appsservice-workerworkbox

Which files should be added to version control after setting up service worker using workbox-cli


After installing workbox and running the following to generate a service worker, there are 5 new files generated. I want to know which files should be version controlled or if they should be generated during the build process.

  • workbox wizard
  • workbox generateSW public/SW.js

The files generated are:

  • sw.js
  • sw.js.map
  • workbox-config.js
  • workbox-ec19d65c.js
  • workbox-ec19d65c.js.map

Solution

  • workbox-config.js contains the configuration created by workbox wizard. You should check that in to version control so that you don't need to run workbox wizard again in the future.

    The other files are all build artifacts, and I'd normally recommend not checking them in to version control. They will be regenerated after each build.