0
serviceWorker vs reportWebVitals
I've started to build a react app using create-react-app (https://create-react-app.dev/docs/getting-started/) and the tutorial I'm following has serviceWorker but the build setup I've downloaded doesn't have serviceWorker and instead has reportWebVitals. Do these two work the same? is serviceWorker not supported anymore? And if I use reportWebVitals, will it affect the working of other files (syntax/logic) ?
1 Odpowiedź
+ 5
In older versions of create-react-app serviceworker was bundled; but newer versions dont have them and have webvitals. You can still use service workers if you want.
https://create-react-app.dev/docs/making-a-progressive-web-app
https://create-react-app.dev/docs/measuring-performance/#web-vitals