From 63dbdfa4a6acc3e61f9288a9a08804eddb664a7f Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 17 Jan 2021 14:47:13 +0100 Subject: [PATCH] removed service worker stuff --- cookbook/static/vue/js/service_worker.js | 1 - vue/package.json | 5 -- vue/src/registerServiceWorker.js | 32 ----------- vue/src/serviceWorker.js | 70 ------------------------ vue/vue.config.js | 19 ------- 5 files changed, 127 deletions(-) delete mode 100644 cookbook/static/vue/js/service_worker.js delete mode 100644 vue/src/registerServiceWorker.js delete mode 100644 vue/src/serviceWorker.js diff --git a/cookbook/static/vue/js/service_worker.js b/cookbook/static/vue/js/service_worker.js deleted file mode 100644 index 9be26c211..000000000 --- a/cookbook/static/vue/js/service_worker.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){function t(t){for(var r,u,i=t[0],s=t[1],c=t[2],p=0,f=[];p request.mode === 'navigate', - // Use a Network First caching strategy - new NetworkFirst({ - // Put all cached files in a cache named 'pages' - cacheName: 'pages', - plugins: [ - // Ensure that only requests that result in a 200 status are cached - new CacheableResponsePlugin({ - statuses: [200], - }), - ], - }), -); - -// Cache CSS, JS, and Web Worker requests with a Stale While Revalidate strategy -registerRoute( - // Check to see if the request's destination is style for stylesheets, script for JavaScript, or worker for web worker - ({ request }) => - request.destination === 'style' || - request.destination === 'script' || - request.destination === 'worker', - // Use a Stale While Revalidate caching strategy - new StaleWhileRevalidate({ - // Put all cached files in a cache named 'assets' - cacheName: 'assets', - plugins: [ - // Ensure that only requests that result in a 200 status are cached - new CacheableResponsePlugin({ - statuses: [200], - }), - ], - }), -); - -// Cache images with a Cache First strategy -registerRoute( - // Check to see if the request's destination is style for an image - ({ request }) => request.destination === 'image', - // Use a Cache First caching strategy - new CacheFirst({ - // Put all cached files in a cache named 'images' - cacheName: 'images', - plugins: [ - // Ensure that only requests that result in a 200 status are cached - new CacheableResponsePlugin({ - statuses: [200], - }), - // Don't cache more than 50 items, and expire them after 30 days - new ExpirationPlugin({ - maxEntries: 50, - maxAgeSeconds: 60 * 60 * 24 * 30, // 30 Days - }), - ], - }), -); \ No newline at end of file diff --git a/vue/vue.config.js b/vue/vue.config.js index b45b366c0..575906b13 100644 --- a/vue/vue.config.js +++ b/vue/vue.config.js @@ -5,10 +5,6 @@ const pages = { entry: './src/apps/RecipeView/main.js', chunks: ['chunk-vendors'] }, - 'service_worker': { - entry: './src/serviceWorker.js', - chunks: ['chunk-vendors'] - }, } module.exports = { @@ -20,21 +16,6 @@ module.exports = { : 'http://localhost:8080/', outputDir: '../cookbook/static/vue/', runtimeCompiler: true, - - pwa: { - name: 'Recipes', - themeColor: '#4DBA87', - msTileColor: '#000000', - appleMobileWebAppCapable: 'yes', - appleMobileWebAppStatusBarStyle: 'black', - - workboxPluginMode: 'GenerateSW', - workboxOptions: { - offlineGoogleAnalytics: false, - inlineWorkboxRuntime: true, - - } - }, chainWebpack: config => { config.optimization.splitChunks({