mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
fix: add /api in pwa navigateFallbackDenylist
This commit is contained in:
parent
2e0f332288
commit
6f05725dd7
@ -8,14 +8,14 @@ import tsconfigPath from "vite-tsconfig-paths"
|
||||
import unocss from "unocss/vite"
|
||||
import dotenv from "dotenv"
|
||||
import type { VitePWAOptions } from "vite-plugin-pwa"
|
||||
// import { VitePWA } from "vite-plugin-pwa"
|
||||
import { VitePWA } from "vite-plugin-pwa"
|
||||
import { projectDir } from "./shared/dir"
|
||||
|
||||
dotenv.config({
|
||||
path: join(projectDir, ".env.server"),
|
||||
})
|
||||
|
||||
const _pwaOption: Partial<VitePWAOptions> = {
|
||||
const pwaOption: Partial<VitePWAOptions> = {
|
||||
includeAssets: ["icon.svg", "apple-touch-icon.png"],
|
||||
manifest: {
|
||||
name: "NewsNow",
|
||||
@ -47,6 +47,9 @@ const _pwaOption: Partial<VitePWAOptions> = {
|
||||
},
|
||||
],
|
||||
},
|
||||
workbox: {
|
||||
navigateFallbackDenylist: [/^\/api/],
|
||||
},
|
||||
devOptions: {
|
||||
enabled: process.env.SW_DEV === "true",
|
||||
type: "module",
|
||||
@ -106,7 +109,7 @@ export default defineConfig({
|
||||
}),
|
||||
unocss(),
|
||||
react(),
|
||||
// VitePWA(pwaOption),
|
||||
VitePWA(pwaOption),
|
||||
nitro(nitroOption),
|
||||
],
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user