- Activated Workbox precache PWA !
importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-sw.js');
if (!workbox) {
workbox = new self.WorkboxSW();
}
if (workbox) {
workbox.core.setCacheNameDetails({prefix: "freeplanet"});
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.suppressWarnings();
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerRoute(/^http/, workbox.strategies.networkFirst(), 'GET');
}
This commit is contained in:
@@ -180,8 +180,18 @@ module.exports = function (ctx) {
|
||||
}
|
||||
},
|
||||
pwa: {
|
||||
// runtimeCaching: [
|
||||
// {
|
||||
// urlPattern: '/statics',
|
||||
// handler: 'networkFirst'
|
||||
// }
|
||||
// ],
|
||||
|
||||
// workboxPluginMode: 'GenerateSW',
|
||||
workboxPluginMode: 'InjectManifest',
|
||||
// workboxOptions: {},
|
||||
workboxOptions: {
|
||||
// swSrc: 'src/sw.js',
|
||||
},
|
||||
manifest: {
|
||||
name: 'Free Planet',
|
||||
short_name: 'freeplanet',
|
||||
|
||||
Reference in New Issue
Block a user