chore: update pwa module configuration

pull/1349/head
userquin 2023-01-20 19:37:37 +01:00
rodzic c189f951ff
commit 8552bc96f9
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -112,11 +112,11 @@ export default defineNuxtModule<VitePWANuxtOptions>({
next()
}
nuxt.hook('vite:serverCreated', (viteServer, { isServer }) => {
if (isServer || !tauriPlatform)
if (isServer)
return
viteServer.middlewares.stack.push({ route: webManifest, handle: emptyHandle })
if (webmanifests) {
if (webmanifests && !tauriPlatform) {
Object.keys(webmanifests).forEach((wm) => {
viteServer.middlewares.stack.push({
route: `${nuxt.options.app.baseURL}manifest-${wm}.webmanifest`,
@ -141,6 +141,7 @@ export default defineNuxtModule<VitePWANuxtOptions>({
}
else {
nuxt.hook('nitro:config', async (nitroConfig) => {
// /manifest.webmanifest added on nuxt config file
if (!tauriPlatform)
return