mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +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()
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|