-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
PWA plugin uses Google CDN by default with no (obvious) way to turn it off #5838
Comments
that concerns me - the reason i want to move to vue is to degooglify my apps |
The worst thing is, that it not only uses CDN but also an outdated version v4.3.1. The current version as of this writing would be v.5.1.3. There is also no easy way to update this, because @vue/cli-plugin-pwa has workbox-webpack-plugin with version ^4.3.1 as dependency (current version again would be 5.1.3) and workbox-webpack-plugin has then workbox-build with version ^4.3.1 as dependency (current version again would be 5.1.3). --- workbox-build is the package responsible for loading from CDN. |
if you are using yarn you can use the resolutions field in the package.json file to update this, it works quite well. it was mentioned here. |
For using a local import (no CDN), see #3361 (comment) |
This no longer works... Google removed support for it. You can see this configuration option present in 2019, when that comment was posted, but isn't there now. Just did a quick search through their repo to confirm that it isn't a hidden config option, and their unit tests ensure that it does not exist. Thank you for pointing that out, though. |
I just generated the service worker with a local import using that option and can confirm that it still works (an extra folder with a dependency is generated into the /dist). Maybe vue-cli is using an old version for that purpose. |
@ssc-hrep3 you're right, my bad... I forgot Vue was using an older version. As mentioned in that issue you linked, though, it would be good to make this a default or at least document it. The one thing is the plan for Vue CLI v5 has a plan to support Workbox 6, which removes this option. |
I don't mean to spam this issue, but this issue in Workbox seems relevant:
Later today I might play around with the Vue CLI dev builds to see if Workbox 6 defaults to building locally instead of using the CDN. It's a bit hard to track progress on this issue. |
Version
4.5.4
Reproduction link
This is just the default created by
vue-cli
with PWAs enabled:https://github.com/KB1RD/google-cdn-default
Environment info
Steps to reproduce
yarn build
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
line.InjectManifest
What is expected?
What is actually happening?
InjectManifest
to make it work, but I still cannot figure out how to remove the CDN (except by editing it out post-build)The text was updated successfully, but these errors were encountered: