Custom SW script



  • Hello,

    I want to be able to customize the SW script generated. The WebPack plugin allows for it, but Quasar (v0.15) seems to not be sending that information to the plugin.

    Quasar code:

    new SWPrecacheWebpackPlugin({
              cacheId: cfg.pwa.cacheId,
              filename: cfg.pwa.filename,
              staticFileGlobs: [`${cfg.build.distDir}/**/*.{${cfg.pwa.cacheExt}}`],
              minify: cfg.build.minify,
              stripPrefix: cfg.build.distDir.replace(/\\/g, '/') + '/'
            }),
    

    Could we also add the importScripts option, so we can import our own SW code?

    What I want to achieve is caching fetch requests and serve them from cache, falling back to a network request (or opposite, it depends).

    Is there a way to customize the SW script?

    Thanks!



  • Maybe there’s another way I’m not aware of?

    Thank you!


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.