This repository template still on progress or not ?

rizkiheryandi
0
rizkiheryandi
commented 2 years ago

Even, no service worker register when i run the template

0
pi0
29.6k
pi0
commented 2 years ago

Hi. Are you running nuxt in dev mode? This template basically should works, only dependencies in package.json may be upgraded :)

0
bovas85
115
bovas85
commented 2 years ago

Try generating a static site, upload to an HTTPS enabled hosting (or use surge after npm i -g surge) and try from there.

Alternatively, build it and run now (npm i -g now first) to upload it there as nodejs app and it should also work

0
bovas85
115
bovas85
commented 2 years ago

@pi0 does this work no matter what we add to it in the nuxt template? (ie. new plugins and so on)

Also, how do we cache ajax requests?

0
colsen1991
8
colsen1991
commented 2 years ago

@bovas85

  workbox: {
    handleFetch: true
  }

in nuxt.config.js works fine for caching ajax requests. Keep in mind that the @nuxtjs/pwa dependency needs to be version 2 or higher for it to work.

And can confirm that it works just fine with a big range of modules and plugins. If you need to tweak the caching of the PWA module, have a look at the documentation for that (https://github.com/nuxt-community/pwa-module) and workbox (https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#abstract-types).

Hope this helps :)

0
bovas85
115
bovas85
commented a year ago

Thanks @colsen1991

0
Informations
Question โ€ข Unresolved
#c12 - Created 2 years ago