Skip to content

Commit 020fff2

Browse files
committed
fix: type error
1 parent 8470a8d commit 020fff2

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/parts/pwa.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
import { installModule, useNuxt } from '@nuxt/kit'
2+
import type { NuxtConfig, NuxtOptions } from '@nuxt/schema'
23
import { provider } from 'std-env'
34

45
export 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
}

0 commit comments

Comments
 (0)