Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q]: How can I "activate" PWA in Dev Server 馃え #26

Closed
domsen123 opened this issue Feb 19, 2021 · 5 comments
Closed

[Q]: How can I "activate" PWA in Dev Server 馃え #26

domsen123 opened this issue Feb 19, 2021 · 5 comments

Comments

@domsen123
Copy link
Contributor

Hi,

is it possible to generate the manifest and sw.js during dev?

Cheerz

@antfu
Copy link
Member

antfu commented Feb 19, 2021

Can you explain a bit about the reason why you want to do this?

@domsen123
Copy link
Contributor Author

for testing :)

right now I have some struggle with the caching...
I am using firebase as hosting... if I deploy a new build to firebase hosting, some pages are not updating...

So I was wondering, If I can activate the PWA in my local dev env to check everything and I dont have to build/deploy all the time to staging env.

furthermore: how I can extend the sw.js? I need to add some logic...

I dont get it

@userquin
Copy link
Member

Just build the project and then install node-static and include the script at bottom of #23 (comment)

You will need to create an SSL certificate...

@userquin
Copy link
Member

userquin commented Feb 19, 2021

you can see this entry, to test build over http:
https://stackoverflow.com/a/53388534/385997

@antfu
Copy link
Member

antfu commented Feb 20, 2021

dev and build are different processes in Vite (the implements are different, so there are many misalignments). I think debugging PWA in dev mode will make it even harder to debug. I'd suggest using build outputs to serve locally as @userquin pointed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants