0

What is the best way to turn my Laravel/Vue SPA into a PWA? I know these options:

The first option, the webpack plugin, seems outdated as it is updated for the last time mid 2018. I could use Workbox but do I have to do something specific for it to work well with Laravel/Vue? I read this answer but I think that's a lot of a hassle and I hope this can be done a lot easier. I don't know if it is required to use webpack. Anyone who has got experience with this and want to help me out? Any information and tips are welcome as I can't find that much of information about this.

Baspa
  • 1,099
  • 1
  • 18
  • 49
  • What is the reason for the downvote? – Baspa Nov 01 '19 at 09:02
  • 2
    most likely reason for downvote was that your question is opinion based. And there is no such thing as "best way" all depends on circumstances. – Arseniy-II Nov 01 '19 at 09:11
  • I would just like to hear some advice from people who have experience with this @Arseniy-II – Baspa Nov 01 '19 at 09:12
  • 1
    yeah I know. I'm writing some kind of answer it will take time. But stackoverflow is bad site for "advices" believe me :) I have had a few questions about "advice" all was either downvoted or asked to be closed. – Arseniy-II Nov 01 '19 at 09:14
  • 2
    Actually I read https://stackoverflow.com/a/57775490/8163773 and it seems like it is your answer. Unfortunately you can't avoid "a lot of a hassle" with PWA. So embrace yourself. My advise for you is to create new small project and start from simple things and add things to it from your main project gradually. What I usually do is I fallback to one `index.vue` file with simple "hello world" make it work and put all my staff back gradually and watch if smth is broke – Arseniy-II Nov 01 '19 at 09:22
  • 1
    Depends on you project complexity that task may require from 2 days up to week or more. – Arseniy-II Nov 01 '19 at 09:26

1 Answers1

1

I've been using workbox with same stack (Laravel + VueJS) and it worked like a charm. Apart from that I don't remember this to be extremely difficult or something similar.

Just installed workbox, add the js reference on the html and not much more, as it is js in the end, once you change your SW the npm run watch will build/reload the app.js and it should work.

Hope it helps

oscarmlage
  • 1,445
  • 2
  • 12
  • 23