vite-pwa / nuxt

Zero-config PWA Plugin for Nuxt 3
https://vite-pwa-org.netlify.app/frameworks/nuxt
MIT License
449 stars 22 forks source link

PWA must add theme-color meta tag #75

Closed modbender closed 7 months ago

modbender commented 1 year ago

So I have deployed a site developed using Nuxt 3 on Netlify, and I have Lighthouse installed as plugin.

The below image is from Netlify lighthouse

image

Version

"@vite-pwa/nuxt": "^0.1.1",

The below is my configuration

pwa: {
    registerType: "autoUpdate",
    manifest: {
      name: "Nuxt Nova",
      short_name: "NuxtNova",
      display: "standalone",
      theme_color: "#212529",
      background_color: "#212529",
      orientation: "portrait-primary",
      description: "Nuxt Nova Blog Template",
      icons: siteLogoIcons,
    },
    workbox: {
      navigateFallback: "/",
      globPatterns: ["**/*.{js,css,html,png,svg,ico}"],
    },
    client: {
      installPrompt: true,
      // you don't need to include this: only for testing purposes
      // if enabling periodic sync for update use 1 hour or so (periodicSyncForUpdates: 3600)
      periodicSyncForUpdates: 20,
    },
    // devOptions: {
    //   enabled: true,
    //   suppressWarnings: true,
    //   navigateFallbackAllowlist: [/^\/$/],
    //   type: "module",
    // },
  },

Since I have already added theme_color to the configuration, I think it would be redundant to manually add a theme-color meta tag separately. This should be a part of VitePwaManifest

Another suggestion is to move VitePwaManifest code to a plugin so that it's automatically added to all pages.

userquin commented 1 year ago

@modbender sorry, but this plugin will not include any metadata to the page, that's something you can do once. For web manifest icons you can use https://github.com/vite-pwa/assets-generator

EDIT: maybe in a future I can include it, I'm trying to add a few enhancements about color scheme and i18n (a lot of work).

modbender commented 1 year ago

Alright, I'll try to add the support and maybe open a PR, it's rather simple actually so.

userquin commented 9 months ago

@modbender there is no need, I'm working to integrate the PWA assets generator api in pwa plugin https://github.com/vite-pwa/vite-plugin-pwa/pull/621 , integrations support will also coming soon