Skip to content

created toggle with process.env.VUE_APP_ALLOW_LOCAL_SW to allow local… #3329

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

bobbybol
Copy link

When building PWA's with complex functionalities and interactions, it may be desirable to have a functioning service worker in development mode. This branch has a toggle in the shape of VUE_APP_ALLOW_LOCAL_SW that, when set to true, allows the developer to have the service worker under development installed on the client while running the development server.

@bobbybol
Copy link
Author

Never mind this - variables on process.env are strings, so boolean check doesn't work. Any advice for what would be a good globally injected variable to use when implementing such a toggle?

@bobbybol
Copy link
Author

I changed the toggle to specifically check for the string 'true'. This works of course, but would be glad to change it if a better option is suggested.

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

Successfully merging this pull request may close these issues.

2 participants