Open ava-cassiopeia opened 6 years ago
I think you are looking for staticFileGlobs
, which you'll want to use in conjunction with mergeStaticsConfig: true
.
I think you maybe use runtimeCaching
https://github.com/goldhand/sw-precache-webpack-plugin/issues/137#issuecomment-374293142
webpack version: 4.5.0
sw-precache-webpack-plugin version: 0.11.5
Please tell us about your environment: OSX 10.x
Browser: Chrome 66
Current behavior:
There is no way (that I know of) to do something like
importScripts
but for static HTML pages that are not a part of the Webpack build.Expected/desired behavior:
Some sort of option for
importScripts
but it's justimportStatic
or similar so that the service worker will cache static pages of HTML.Example:
☝🏻That would cause the service worker to cache the HTML present in the result of those URLs.
Additional context:
I'm using Laravel + Vue.js, so the Laravel bits are responsible for certain URLs returning certain HTML, so webpack doesn't know about any of the files being outputted because it's dynamically generated and served by Laravel. Maybe I'm just holding it wrong for this plugin, but I can't find a way to get it to generate a service worker file that includes certain, arbitrary URLs to be precached as well.