Commit ccc3c320 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt

register service worker early-on

since we don’t need and use our register-service-worker
patch anymore, we need to register the service worker before
the window.load event fires.

see: https://github.com/yyx990803/register-service-worker/pull/33
parent b4613372
......@@ -15,7 +15,9 @@ import 'vue-resize/dist/vue-resize.css'
import './styles/main.scss'
import './components/register'
import { registerPWA } from './util/pwa'
import { registerPWA, registerServiceWorker } from './util/pwa'
registerServiceWorker()
Vue.config.productionTip = false
Vue.config.keyCodes = {
......
import Vue from 'vue'
import { register as registerServiceWorker } from 'register-service-worker'
import { register } from 'register-service-worker'
const THEME_COLOR = '#24242e'
......@@ -41,11 +41,14 @@ function injectWebAppMetadata (env, el = document.head) {
}
}
export function registerServiceWorker () {
register(`${process.env.BASE_URL}service-worker.js`)
}
export function registerPWA (env) {
preloadConnections(env)
if (env.integration) {
injectWebAppMetadata(env)
registerServiceWorker(`${process.env.BASE_URL}service-worker.js`)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment