removed service worker stuff

This commit is contained in:
vabene1111
2021-01-17 14:47:13 +01:00
parent 961b3f07b5
commit 63dbdfa4a6
5 changed files with 0 additions and 127 deletions

View File

@ -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<i.length;p++)u=i[p],Object.prototype.hasOwnProperty.call(a,u)&&a[u]&&f.push(a[u][0]),a[u]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);l&&l(t);while(f.length)f.shift()();return o.push.apply(o,c||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,i=1;i<n.length;i++){var s=n[i];0!==a[s]&&(r=!1)}r&&(o.splice(t--,1),e=u(u.s=n[0]))}return e}var r={},a={service_worker:0},o=[];function u(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.m=e,u.c=r,u.d=function(e,t,n){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},u.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)u.d(n,r,function(t){return e[t]}.bind(null,r));return n},u.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="";var i=window["webpackJsonp"]=window["webpackJsonp"]||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var l=s;o.push([1,"chunk-vendors"]),n()})({1:function(e,t,n){e.exports=n("a02d")},a02d:function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var r=n("4d4d"),a=n("9609"),o=n("9829"),u=n("1737");Object(r["a"])((function(e){var t=e.request;return"navigate"===t.mode}),new a["b"]({cacheName:"pages",plugins:[new o["a"]({statuses:[200]})]})),Object(r["a"])((function(e){var t=e.request;return"style"===t.destination||"script"===t.destination||"worker"===t.destination}),new a["c"]({cacheName:"assets",plugins:[new o["a"]({statuses:[200]})]})),Object(r["a"])((function(e){var t=e.request;return"image"===t.destination}),new a["a"]({cacheName:"images",plugins:[new o["a"]({statuses:[200]}),new u["a"]({maxEntries:50,maxAgeSeconds:2592e3})]}))}});

View File

@ -12,13 +12,10 @@
"bootstrap-vue": "^2.21.2",
"core-js": "^3.6.5",
"moment": "^2.29.1",
"register-service-worker": "^1.7.1",
"vue": "^2.6.11",
"vue-multiselect": "^2.1.6",
"vue-template-compiler": "^2.6.12",
"vuex": "^3.6.0",
"workbox-cacheable-response": "^6.0.2",
"workbox-expiration": "^6.0.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
@ -29,8 +26,6 @@
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0-0",
"webpack-bundle-tracker": "0.4.3",
"workbox-routing": "^6.0.2",
"workbox-strategies": "^6.0.2"
},
"resolutions": {
"@vue/cli-plugin-pwa/workbox-webpack-plugin": "^5.1.3"

View File

@ -1,32 +0,0 @@
/* eslint-disable no-console */
import { register } from 'register-service-worker'
if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, {
ready () {
console.log(
'App is being served from cache by a service worker.\n' +
'For more details, visit https://goo.gl/AFskqB'
)
},
registered () {
console.log('Service worker has been registered.')
},
cached () {
console.log('Content has been cached for offline use.')
},
updatefound () {
console.log('New content is downloading.')
},
updated () {
console.log('New content is available; please refresh.')
},
offline () {
console.log('No internet connection found. App is running in offline mode.')
},
error (error) {
console.error('Error during service worker registration:', error)
}
})
}

View File

@ -1,70 +0,0 @@
import { registerRoute } from 'workbox-routing';
import {
NetworkFirst,
StaleWhileRevalidate,
CacheFirst,
} from 'workbox-strategies';
// Used for filtering matches based on status code, header, or both
import { CacheableResponsePlugin } from 'workbox-cacheable-response';
// Used to limit entries in cache, remove entries after a certain period of time
import { ExpirationPlugin } from 'workbox-expiration';
// Cache page navigations (html) with a Network First strategy
registerRoute(
// Check to see if the request is a navigation to a new page
({ request }) => 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
}),
],
}),
);

View File

@ -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({