fix(pwa): resolve workbox-window build error with Cloudflare plugin
Add workbox-window as direct dependency and set injectRegister: false to prevent conflict between vite-plugin-pwa and @cloudflare/vite-plugin. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d199e9e3a8
commit
c80a6fa94b
3 changed files with 5 additions and 0 deletions
|
|
@ -68,6 +68,7 @@
|
||||||
"vite-plugin-pwa": "^1.2.0",
|
"vite-plugin-pwa": "^1.2.0",
|
||||||
"vite-tsconfig-paths": "^5.1.4",
|
"vite-tsconfig-paths": "^5.1.4",
|
||||||
"vitest": "^3.2.4",
|
"vitest": "^3.2.4",
|
||||||
|
"workbox-window": "^7.4.0",
|
||||||
"wrangler": "^4.24.3"
|
"wrangler": "^4.24.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ export default defineConfig(({ mode }) => {
|
||||||
plugins.push(
|
plugins.push(
|
||||||
VitePWA({
|
VitePWA({
|
||||||
registerType: "autoUpdate",
|
registerType: "autoUpdate",
|
||||||
|
injectRegister: false,
|
||||||
includeAssets: [
|
includeAssets: [
|
||||||
"public/icon.jpg",
|
"public/icon.jpg",
|
||||||
"public/logo_dark.png",
|
"public/logo_dark.png",
|
||||||
|
|
|
||||||
|
|
@ -501,6 +501,9 @@ importers:
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^3.2.4
|
specifier: ^3.2.4
|
||||||
version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.12)(happy-dom@20.0.7)(jiti@2.6.1)(jsdom@20.0.3)(lightningcss@1.30.2)(terser@5.46.1)(tsx@4.20.6)
|
version: 3.2.4(@types/debug@4.1.12)(@types/node@22.18.12)(happy-dom@20.0.7)(jiti@2.6.1)(jsdom@20.0.3)(lightningcss@1.30.2)(terser@5.46.1)(tsx@4.20.6)
|
||||||
|
workbox-window:
|
||||||
|
specifier: ^7.4.0
|
||||||
|
version: 7.4.0
|
||||||
wrangler:
|
wrangler:
|
||||||
specifier: ^4.24.3
|
specifier: ^4.24.3
|
||||||
version: 4.44.0
|
version: 4.44.0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue