0

(I'm using Nuxt 3.0.0-rc.13 and @kevinmarrec/nuxt-pwa 0.9.1, but I think my question is generic to any PWA.)

In my nuxt.config.ts file, I have defined my PWA with these two sections:

modules: [
  ['@kevinmarrec/nuxt-pwa'],
],      

and

pwa: {
  manifest: {
    name: "My App",
    lang: 'en'
  },
  workbox: {
    offlineAssets: [ "/fonts/*.ttf", "/fonts/*.woff", "/fonts/*.svg" ]
  }
},

When I'm connected to the internet, my fonts load and it looks right. When I'm not connected to the internet, the app works just fine but the fonts are not loaded and I get the fallback fonts.

All my fonts are hosted on the website in the /fonts folder.

kissu
  • 40,416
  • 14
  • 65
  • 133
Paulie
  • 1,940
  • 3
  • 20
  • 34
  • 1
    [This issue](https://stackoverflow.com/q/52451678/8816585) and [that one](https://stackoverflow.com/q/53503761/8816585) are not the most recent questions meanwhile, none of them are referencing `offlineAssets` and I could not find anything about it. The fact that I'm not a Workbox expert doesn't help of course haha. You could maybe give a try on creating a [Github issue](https://github.com/kevinmarrec/nuxt-pwa-module) or pinging him directly on Twitter, [his DMs are open](https://twitter.com/K_Marrec). Working with a layer on top of the initial thing can always be a bit tricky. – kissu Nov 07 '22 at 17:43
  • 1
    Oh, you're referring to the official pwa module (not yet supported by Nuxt3 as far as I can see): https://pwa.nuxtjs.org/workbox#offlineassets Not sure that this has been backported to the one of Marrec. – kissu Nov 07 '22 at 17:47
  • 1
    The PWA part is [supposed to be part of the core of the framework](https://v3.nuxtjs.org/community/roadmap/#%EF%B8%8F-roadmap) anyway, the team is currently working on it. Here is a related [github discussion](https://github.com/nuxt/framework/discussions/1823) if you want to track the progress. – kissu Nov 07 '22 at 17:49

0 Answers0