Skip to content

Conversation

mmrqa
Copy link

@mmrqa mmrqa commented Sep 4, 2025

In preparation for the development of an openIMIS Offline-Mode I appended the incomplete example of CRA Service-Worker. Used the offical example from https://create-react-app.dev/docs/making-a-progressive-web-app/

This relates to the Bug https://openimis.atlassian.net/browse/OP-2552

Changed the registration of the serviceWorker to opt-in as otherwise all static content will be cached in the future.

@delcroip
Copy link
Member

delcroip commented Sep 5, 2025

that looks interesting, do you think this will work with vite (in few weeks we should merge the vite-migration branch in dev)

@mmrqa
Copy link
Author

mmrqa commented Sep 7, 2025

that looks interesting, do you think this will work with vite (in few weeks we should merge the vite-migration branch in dev)

should also work with vite since both use the workbox library. For vite you need to add some more config afterwards (https://github.com/vite-pwa/create-pwa/blob/main/templates/template-react/vite.config.js)

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.

2 participants