️ perf: refactor pwa implement to have better performance (#4124)

* test remove serwist

* 尝试优化 pwa install 实现

* Update next.config.mjs

* fix lint

* delay the service worker register

* only enabled on prod

* when isShowPWAGuide update, trigger guide too
This commit is contained in:
Arvin Xu
2024-09-25 22:00:28 +08:00
committed by GitHub
parent bfb7675125
commit 7e3aa09510
13 changed files with 135 additions and 77 deletions

View File

@@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": ["dom", "dom.iterable", "esnext", "webworker"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -16,7 +16,7 @@
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"types": ["vitest/globals"],
"types": ["vitest/globals", "@serwist/next/typings"],
"paths": {
"@/*": ["./src/*"],
"~test-utils": ["./tests/utils.tsx"]
@@ -27,7 +27,7 @@
}
]
},
"exclude": ["node_modules"],
"exclude": ["node_modules", "public/sw.js"],
"include": [
"next-env.d.ts",
"vitest.config.ts",