mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-18 10:17:16 +00:00
20 lines
491 B
JavaScript
20 lines
491 B
JavaScript
|
if (process.env.NODE_ENV === 'production') {
|
||
|
var OfflinePlugin = require('offline-plugin/runtime')
|
||
|
window.onNuxtReady(() => {
|
||
|
OfflinePlugin.install({
|
||
|
onInstalled: function () {
|
||
|
console.log('Offline plugin installed.') // eslint-disable-line no-console
|
||
|
},
|
||
|
onUpdating: function () {
|
||
|
|
||
|
},
|
||
|
onUpdateReady: function () {
|
||
|
OfflinePlugin.applyUpdate()
|
||
|
},
|
||
|
onUpdated: function () {
|
||
|
window.location.reload()
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|