Answer the question
In order to leave comments, you need to log in
Where did serviceWorker.js go?
Deployed the project with create-react-app
. After installing firebase, the serviceWorker.js file disappeared - the standard file that appears when the project is deployed. Instead, the reportWebVitals.js file appeared. Googled, this is some new feature from Google used for optimization.
Tell me how it is generally connected and is serviceWorker.js needed for the full operation of the React application? If I understand correctly, serviceWorker.js is needed for the application to work properly offline.
Or tell me where you can read more about it.
Answer the question
In order to leave comments, you need to log in
Service Worker has become optional since version 4 of CRA and is needed to create a PWA.
You can find more about this in the documentation .
Starting with Create React App 4, you can add asrc/service-worker.js
file to your project to use the built-in support for Workbox'sInjectManifest
plugin, which will compile your service worker and inject into it a list of URLs to precache.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question