Skip to content

Commit

Permalink
ci(sw): hold service worker until it is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
edm00se committed Apr 9, 2021
1 parent 59228ff commit 30cbe43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build]
base = "/"
publish = "/dist/"
command = "npm run build && npm run build:sw"
command = "npm run build" # && npm run build:sw
[[plugins]]
package = "netlify-plugin-gridsome-cache"
9 changes: 8 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ export default function(Vue, { router, head, isClient }) {
Vue.component('Layout', DefaultLayout);
}

if (process.isClient && process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
if (
process.isClient &&
process.env.NODE_ENV === 'production' &&
'serviceWorker' in navigator
) {
console.log('no service worker time... baby');
/*
const {Workbox} = require('workbox-window');
console.log('service worker time baby!');
const wb = new Workbox('/sw.js');
Expand All @@ -22,4 +28,5 @@ if (process.isClient && process.env.NODE_ENV === 'production' && 'serviceWorker'
}
});
wb.register();
*/
}

0 comments on commit 30cbe43

Please sign in to comment.