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 unocss from "unocss/vite"
|
||||||
import dotenv from "dotenv"
|
import dotenv from "dotenv"
|
||||||
import type { VitePWAOptions } from "vite-plugin-pwa"
|
import type { VitePWAOptions } from "vite-plugin-pwa"
|
||||||
// import { VitePWA } from "vite-plugin-pwa"
|
import { VitePWA } from "vite-plugin-pwa"
|
||||||
import { projectDir } from "./shared/dir"
|
import { projectDir } from "./shared/dir"
|
||||||
|
|
||||||
dotenv.config({
|
dotenv.config({
|
||||||
path: join(projectDir, ".env.server"),
|
path: join(projectDir, ".env.server"),
|
||||||
})
|
})
|
||||||
|
|
||||||
const _pwaOption: Partial<VitePWAOptions> = {
|
const pwaOption: Partial<VitePWAOptions> = {
|
||||||
includeAssets: ["icon.svg", "apple-touch-icon.png"],
|
includeAssets: ["icon.svg", "apple-touch-icon.png"],
|
||||||
manifest: {
|
manifest: {
|
||||||
name: "NewsNow",
|
name: "NewsNow",
|
||||||
@ -47,6 +47,9 @@ const _pwaOption: Partial<VitePWAOptions> = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
workbox: {
|
||||||
|
navigateFallbackDenylist: [/^\/api/],
|
||||||
|
},
|
||||||
devOptions: {
|
devOptions: {
|
||||||
enabled: process.env.SW_DEV === "true",
|
enabled: process.env.SW_DEV === "true",
|
||||||
type: "module",
|
type: "module",
|
||||||
@ -106,7 +109,7 @@ export default defineConfig({
|
|||||||
}),
|
}),
|
||||||
unocss(),
|
unocss(),
|
||||||
react(),
|
react(),
|
||||||
// VitePWA(pwaOption),
|
VitePWA(pwaOption),
|
||||||
nitro(nitroOption),
|
nitro(nitroOption),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user