DEV Community

Discussion on: Convert React App into a Progressive Web App (PWA)

Collapse
 
emmytobs profile image
Emmytobs

Using create-react-app puts in a 'serviceWorker.js' file in the root of my app while the manifest lives in the public folder. I will like to know if calling 'serviceWorker.register()' in the index.js file will be enough to install, activate and cache the desired files.

I am asking this because, in the 'worker.js' file, I can't really know what files to cache. I do not have any static files that i can easily point to. Moreover, there will be a build folder where all my application code will be bundled and minified.

Please could you help further explain what you did when you added the '/' and '/completed' files in the worker.js file to cache. Thanks