Replies: 1 comment
-
Is it possible to register serviceWorker in DEV mode ? Currently when I make a code change to my custom serviceWorker code then I need build and serve app to test the application instead of running the app in dev mode to hot reload when code changes and makes the development faster and saving time. Thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to try PWA with create react app version 4.0, i did manage to generate new project as below
npx create-react-app my-app --template cra-template-pwa-typescript
When i try to run
npm start
i don't see any service-worker.js registered in chrome browser but if i build and serve then it works fine. I would like to register service-worker.js in dev mode, so i followed this article Easy Workbox Integration with create-react-app I have removed the production environment check in serviceWorkerRegistration.ts but no luck.serviceWorkerRegistration.ts
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator)
Please advise ?
Thanks
Bhavesh
Beta Was this translation helpful? Give feedback.
All reactions