diff --git a/CHANGELOG.md b/CHANGELOG.md index 62dd5bba..cfbb6b37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Next - [feat] [humans.txt](/humans.txt) +- [feat] pwa auto update on new changes ## 1.5.1 - [feat] switched back to history mode (no more '#' in url) diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js index 76cede07..981ae903 100644 --- a/src/registerServiceWorker.js +++ b/src/registerServiceWorker.js @@ -20,7 +20,8 @@ if (process.env.NODE_ENV === 'production') { console.log('New content is downloading.') }, updated () { - console.log('New content is available; please refresh.') + console.log('New content is available; hard refresh.'); + window.location.reload(true); }, offline () { console.log('No internet connection found. App is running in offline mode.') diff --git a/vue.config.js b/vue.config.js index 8f6b8404..b0d6125b 100644 --- a/vue.config.js +++ b/vue.config.js @@ -19,5 +19,11 @@ module.exports = { }) ] } + }, + pwa: { + workboxOptions: { + skipWaiting: true, + clientsClaim: true, + } } } \ No newline at end of file