Fix build breaking due to workbox

This commit is contained in:
Bill Thornton 2020-11-19 16:27:44 -05:00
parent 65fe2b79e8
commit 5682673adf
2 changed files with 7 additions and 5 deletions

View File

@ -57,7 +57,6 @@
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2",
"webpack-stream": "^6.1.1",
"workbox-core": "^5.1.4",
"workbox-webpack-plugin": "^5.1.4",
"worker-plugin": "^5.0.0"
},
@ -91,7 +90,9 @@
"sortablejs": "^1.12.0",
"swiper": "^6.3.5",
"webcomponents.js": "^0.7.24",
"whatwg-fetch": "^3.5.0"
"whatwg-fetch": "^3.5.0",
"workbox-core": "^5.1.4",
"workbox-precaching": "^5.1.4"
},
"babel": {
"presets": [

View File

@ -1,7 +1,9 @@
/* eslint-env serviceworker */
/* eslint-disable-next-line import/namespace,import/named */
/* eslint-disable import/namespace,import/named */
import { skipWaiting, clientsClaim } from 'workbox-core';
import { precacheAndRoute } from 'workbox-precaching';
/* eslint-enable import/namespace,import/named */
skipWaiting();
clientsClaim();
@ -43,6 +45,5 @@ self.addEventListener('notificationclick', function (event) {
}, false);
// this is needed by the webpack Workbox plugin
// this plugin is not fully supported in webpack v5. pecaching is disabled until version 6 of this plugin is released
/* eslint-disable-next-line no-restricted-globals,no-undef */
//workbox.precaching.precacheAndRoute(self.__WB_MANIFEST);
precacheAndRoute(self.__WB_MANIFEST);