Open nicodes opened 1 year ago
Found my issue, needed to include <VitePwaManifest />
in app.vue
. I think we should add this step to the docs. Full example below:
<template>
<div>
<VitePwaManifest />
<NuxtWelcome />
</div>
</template>
I think this section could be made for obvious as i also completely missed this
If it's solved, then @nicodes please close this issue.
export default defineNuxtConfig({
runtimeConfig: {
public: envData,
},
router: {
mode: "history",
},
buildModules: [
"@nuxtjs/composition-api/module",
["@pinia/nuxt", { disableVuex: false }],
"@nuxtjs/tailwindcss",
],
modules: [
"@vite-pwa/nuxt",
"@element-plus/nuxt",
"@pinia/nuxt",
"@pinia-plugin-persistedstate/nuxt",
],
pwa: {
registerType: "autoUpdate",
manifest: {
name: "D",
short_name: "D",
theme_color: "#ffffff",
icons: [
{
src: "pwa-192x192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "pwa-512x512.png",
sizes: "512x512",
type: "image/png",
},
{
src: "pwa-512x512.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable",
},
],
},
workbox: {
globPatterns: ["*/.{js,css,html,png,svg,ico}"],
},
client: {
installPrompt: true,
periodicSyncForUpdates: 20,
},
devOptions: {
enabled: true,
suppressWarnings: true,
navigateFallbackAllowlist: [/^\/$/],
type: "module",
},
},
plugins: [
// { src: '@/plugins/service-worker.ts', mode: 'client' }
// '~/plugins/dict',
// '~/router.js'
// { src: '~/plugins/router.plugin.ts', mode: 'client' },
],
pinia: {
autoImports: [
// automatically imports defineStore
"defineStore", // import { defineStore } from 'pinia'
["defineStore", "definePiniaStore"], // import { defineStore as definePiniaStore } from 'pinia'
],
},
build: {
transpile: ["/^element-plus/", "vue-i18n"],
extractCSS: { allChunks: true },
}
Production environments do not see pwa downloads,How to configure?
Hello, I just created a brand new
nuxt
app and setup this package but no manifest.json is detected. Specifically I am using"nuxt": "^3.5.2"
and"@vite-pwa/nuxt": "^0.1.0"
. I have setupvite-pwa
before withsveltekit
so I am somewhat familiar with the process, but I can't figure out why this wont work withnuxt
?Below is my config file: