fix: add self destroying service-worker.js to migrate everyone from CRA to Vite (#6833)

* fix: add self destroying service-worker.js to migrate everyone from CRA to VITE

* add comment

* don't add service-worker.js to app pre-cache
This commit is contained in:
Aakansha Doshi 2023-07-31 19:56:50 +05:30 committed by GitHub
parent 12e37e3dd2
commit 6126c34dc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

@ -61,7 +61,7 @@ export default defineConfig({
workbox: {
// Don't push fonts and locales to app precache
globIgnores: ["fonts.css", "**/locales/**"],
globIgnores: ["fonts.css", "**/locales/**", "service-worker.js"],
runtimeCaching: [
{
urlPattern: new RegExp("/.+.(ttf|woff2|otf)"),