feat: PWA using @vite-pwa/nuxt module with auto update strategy (#75)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
1 parent
575149c356
commit
ac3bac5513
20 files changed
+2558
-705
No files matched your search
@@ -1,11 +1,18 @@
|
||||
import { pwa } from './config/pwa'
|
||||
import { appDescription } from './constants/index'
|
||||
|
||||
export default defineNuxtConfig({
|
||||
modules: [
|
||||
'@vueuse/nuxt',
|
||||
'@unocss/nuxt',
|
||||
'@pinia/nuxt',
|
||||
'@nuxtjs/color-mode',
|
||||
'@vite-pwa/nuxt',
|
||||
],
|
||||
experimental: {
|
||||
// when using generate, payload js assets included in sw precache manifest
|
||||
// but missing on offline, disabling extraction it until fixed
|
||||
payloadExtraction: false,
|
||||
reactivityTransform: true,
|
||||
inlineSSRStyles: false,
|
||||
},
|
||||
@@ -15,4 +22,32 @@ export default defineNuxtConfig({
|
||||
colorMode: {
|
||||
classSuffix: '',
|
||||
},
|
||||
nitro: {
|
||||
esbuild: {
|
||||
options: {
|
||||
target: 'esnext',
|
||||
},
|
||||
},
|
||||
prerender: {
|
||||
crawlLinks: false,
|
||||
routes: ['/'],
|
||||
ignore: ['/hi'],
|
||||
},
|
||||
},
|
||||
app: {
|
||||
head: {
|
||||
viewport: 'width=device-width,initial-scale=1',
|
||||
link: [
|
||||
{ rel: 'icon', href: '/favicon.ico', sizes: 'any' },
|
||||
{ rel: 'icon', type: 'image/svg+xml', href: '/nuxt.svg' },
|
||||
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
|
||||
],
|
||||
meta: [
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||
{ name: 'description', content: appDescription },
|
||||
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
|
||||
],
|
||||
},
|
||||
},
|
||||
pwa,
|
||||
})
|
||||
Reference in new issue
Block a user