pmndrs / react-three-next

React Three Fiber, Threejs, Nextjs starter
https://react-three-next.vercel.app/
MIT License
2.52k stars 342 forks source link

Two unrelated files present in project when installing with 'npx create-r3f-app next' #100

Closed X-Equals-Zero closed 2 years ago

X-Equals-Zero commented 2 years ago

After setting up the project, there are two files called 'sw.js' and 'workbox-6a1bf588.js' in the /public folder.

I've never had such files in next projects, nor are they in the repository, so I am curious what they are for?

sw.txt workbox-6a1bf588.txt

pi43r commented 2 years ago

I assume these are from the https://github.com/shadowwalker/next-pwa package. They allow users to install the app and use it offline.

More on service workers here: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers and workbox: https://developer.chrome.com/docs/workbox/what-is-workbox/