forked from Mirrors/elk
refactor: use route rules for prerendering
This commit is contained in:
parent
c25715b26d
commit
7da49afde5
1 changed files with 5 additions and 2 deletions
|
@ -121,7 +121,12 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
routeRules: {
|
routeRules: {
|
||||||
|
// Static generation
|
||||||
|
'/': { prerender: true },
|
||||||
|
'/settings/**': { prerender: false },
|
||||||
|
// incremental regeneration
|
||||||
'/api/list-servers': { swr: true },
|
'/api/list-servers': { swr: true },
|
||||||
|
// CDN cache rules
|
||||||
'/manifest.webmanifest': {
|
'/manifest.webmanifest': {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/manifest+json',
|
'Content-Type': 'application/manifest+json',
|
||||||
|
@ -139,8 +144,6 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
prerender: {
|
prerender: {
|
||||||
crawlLinks: true,
|
crawlLinks: true,
|
||||||
routes: ['/'],
|
|
||||||
ignore: ['/settings'],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sourcemap: !isDevelopment,
|
sourcemap: !isDevelopment,
|
||||||
|
|
Loading…
Reference in a new issue