Skip to content

runtimeCaching does not work in production mode #898

@secretqsan

Description

@secretqsan

I use vite-pwa/nuxt in my nuxt project, and I hope my app could be offline available. Everything works well when I start my app by nuxt dev. But when I start my app by nuxt build and nuxt preview, the runtimeCaching just can't work. Bellow is my config file.

export const pwaConfig = {
  registerType: 'autoUpdate',
  devOptions: {
    enabled: true,
    type: 'module',
  },
  manifest: {
 .......
  },
  workbox: {
    globPatterns: [
      '**/*.*'
    ],
    runtimeCaching: [
        {
          urlPattern: /^https?:\/\//,
          handler: 'NetworkFirst',
          options: { cacheName: 'api' }
        }
    ]
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions