Import the @kevinmarrec/nuxt-pwa module to fix the related bugs of PWA feature.

This commit is contained in:
Rafi
2023-03-21 22:13:02 +08:00
parent 3992121b71
commit 35d4292d29
6 changed files with 222 additions and 2073 deletions

View File

@@ -25,36 +25,18 @@ export default defineNuxtConfig({
'highlight.js/styles/panda-syntax-dark.css',
],
modules: [
'@vite-pwa/nuxt',
'@kevinmarrec/nuxt-pwa',
'@nuxtjs/color-mode',
'@nuxtjs/i18n',
],
pwa: {
registerType: 'autoUpdate',
manifest: {
name: appName,
short_name: appName,
icons: [
{
src: 'icon-black.svg',
sizes: '900x900',
purpose: 'any maskable',
}
],
description: 'A ChatGPT web Client'
},
workbox: {
navigateFallback: '/',
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
},
client: {
installPrompt: true,
// you don't need to include this: only for testing purposes
// if enabling periodic sync for update use 1 hour or so (periodicSyncForUpdates: 3600)
periodicSyncForUpdates: 20,
},
devOptions: {
enabled: false,
type: 'module',
enabled: true
}
},
i18n: {