-
Notifications
You must be signed in to change notification settings - Fork 18
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
Disable service worker on localhost #96
Comments
ping @Nooshu you maybe have an idea on how to so this the simplest way? |
Hey @soulgalore, agreed the SW in local development can be very annoying, as you usually have to always make sure "Update on reload" / "Bypass for network" checkboxes are checked in Chrome under the "Application" --> "Service worker" tab. One fix I've added in the past is a detection for production. If production, output the SW registration module script. If development, simply omit it. This will stop the SW registering at all. I think there are 2 options:
Personally I think the environment variables is a better idea as it can be used in other areas of the page if required. The JavaScript method seems unreliable (e.g. you could be running your local dev environment off something other than |
Thank you @Nooshu ! I'll try to fix this tomorrow. I agree that the env solution is better, right now though the index.html file is untouched (we don't do anything with it before pushing it) so just doing the JS way should be the fastest way to fix it. So maybe I just do that first and then later and the other solution ... maybe :) |
Yes that's a good point, there's no templating being used to hook into with the env variables. Although this could be a possibility: PostHTML and this example here. |
I've been implementing #95 this weekend and it's been pretty annoying since changes doesn't always come through. I've tested with Safari, Firefox and Chrome and I get the same thing everywhere. It works for a while but then stops. Clearing the browser cache solves the problem.
The text was updated successfully, but these errors were encountered: