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

Allows service worker to run in production mode only #12541

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

karinathomasbbc
Copy link
Contributor

Overall changes

Ensures the service worker can run on local environments, but only when running yarn build; yarn start, as there was an issue with webpack + cached files.

Code changes

  • Update service worker to remove localhost check & update tests
  • Update service worker component to only register the service worker when in production mode (yarn dev = development mode whilst yarn start is production mode, as well as the test & live environments)

Testing

  • Run yarn dev & check service worker in incognito browser - service worker not activated
  • Run yarn build; yarn start & check service worker in incognito browser - service worker is activated

…dev` but `yarn build; yarn start` and test/live environments
@karinathomasbbc karinathomasbbc self-assigned this Mar 21, 2025
Copy link
Contributor

@amoore108 amoore108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we had a note/readme on the local development for this just so people know to yarn build and yarn start to see changes?

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

Successfully merging this pull request may close these issues.

3 participants