mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-12 15:27:13 +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()
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|