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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New "pwalocalserve" mode to inject manifest and get service worker debugging #6457

Open
kb-coder opened this issue May 6, 2021 · 1 comment

Comments

@kb-coder
Copy link

kb-coder commented May 6, 2021

What problem does this feature solve?

Workbox will only add debugging when the NodeEnv is development (see GoogleChrome/workbox#1619 (comment)), but the cli-plugin-pwa does not give us a way to run the injected version of the pwa in a way that we can get debugging info because it only injects the manifest when NodeEnv is production (see https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-pwa/index.js).

It would be helpful to support the following use cases:

  1. Development mode with no manifest injection
  2. Development mode (new "pwalocalserve") with manifest injection and debugging
  3. Production mode manifest injection with no debugging.

Can we get a "pwalocalserve" that builds the PWA with the injected manifest and debugging so we can troubleshoot issues with custom service worker code?

What does the proposed API look like?

pwa-build": "vue-cli-service build --mode pwalocalserve",

@kb-coder
Copy link
Author

I ended up forking the pwa plugin here: https://github.com/kb-coder/vue-cli-plugin-workbox-pwa

This uses workbox, InjectManifest, and sets up a pwalocalserve mode that runs in Node_Env='development' but allows us to run the pwa so we can debug the service worker. I also added some common features of a PWA:

  • user based prompt when a new version of the service worker is available
  • auto update of the service worker (for a landing page / login page).
    I would love to see this code incorporated back into Vue CLI.

@kb-coder kb-coder mentioned this issue May 26, 2021
7 tasks
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

1 participant