Open Cooya opened 3 years ago
As sw-precache is now deprecated, I would suggest to update the doc here with workbox-cli. For instance :
package.json
"scripts": { "build-snap": "react-scripts build && react-snap && workbox generateSW scripts/workbox-config.js }
scripts/workbox-config.js
module.exports = { globDirectory: 'build/', globPatterns: ['**/*.{html,json,js,css,txt}'], swDest: 'build/service-worker.js', sourcemap: false };
I knew nothing about both of them and I had to spend some time to understand how to generate a custom service worker for SSR. I think it would be great to show this already figured out configuration in the doc for other beginners like me :blush:
As sw-precache is now deprecated, I would suggest to update the doc here with workbox-cli. For instance :
package.json
scripts/workbox-config.js
I knew nothing about both of them and I had to spend some time to understand how to generate a custom service worker for SSR. I think it would be great to show this already figured out configuration in the doc for other beginners like me :blush: