lukeed / pwa

(WIP) Universal PWA Builder
https://pwa.cafe
3.13k stars 100 forks source link

Config for supplying own service worker file #64

Open lukasIO opened 5 years ago

lukasIO commented 5 years ago

I tried to understand the custom config options for pwa.config.js, but could not find a way to get the workbox options (particularly, which swSrc applied in my build.

the config file looks like this right now:

exports.workbox = {
    advanced: false, // alias
    injectManifest: false, // alias
    swSrc: './service_worker.js', // template; mode: InjectManifest
    navigateFallbackWhitelist: [/^(?!\/__).*/], // mode: GenerateSW
    navigateFallback: 'index.html', // mode: GenerateSW
    swDest: 'sw.js',
    exclude: [
      /\.git/,
      /\.map$/,
      /\.DS_Store/,
      /^manifest.*\.js(?:on)?$/,
      /\.gz(ip)?$/,
      /\.br$/
    ]
  }

thanks for any pointers!