File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { installModule , useNuxt } from '@nuxt/kit'
2+ import type { NuxtConfig , NuxtOptions } from '@nuxt/schema'
23import { provider } from 'std-env'
34
45export const setupPWA = async ( ) => {
56 const nuxt = useNuxt ( )
67
7- nuxt . options . pwa ||= { }
8+ nuxt . options . pwa ||= { } as NuxtOptions [ 'pwa' ]
9+
10+ const pwaOptions : NuxtConfig [ 'pwa' ] = nuxt . options . pwa
811
912 if ( provider === 'stackblitz' ) {
10- nuxt . options . pwa . icon = false
13+ pwaOptions . icon = false
1114 console . warn (
1215 'Disabling PWA icon generation as `sharp` is not currently supported on StackBlitz.'
1316 )
1417 }
1518
1619 // Generate splash screens for iOS
17- nuxt . options . pwa . meta ||= { }
18- nuxt . options . pwa . meta . mobileAppIOS ??= true
20+ pwaOptions . meta ||= { }
21+ pwaOptions . meta . mobileAppIOS ??= true
1922
2023 await installModule ( '@kevinmarrec/nuxt-pwa' )
2124}
You can’t perform that action at this time.
0 commit comments