nuxt-community / pwa-template

PWA template for vue-cli based on the starter template
MIT License
133 stars 12 forks source link

This repository template still on progress or not ? #14

Closed rizkiheryandi closed 6 years ago

rizkiheryandi commented 6 years ago

Even, no service worker register when i run the template

This question is available on Nuxt.js community (#c12)
pi0 commented 6 years ago

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

bovas85 commented 6 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

bovas85 commented 6 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?

colsen1991 commented 6 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 :)

bovas85 commented 6 years ago

Thanks @colsen1991