-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
116 lines (103 loc) · 4.03 KB
/
nuxt.config.ts
File metadata and controls
116 lines (103 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// https://nuxt.com/docs/api/configuration/nuxt-config
// @ts-nocheck — `.nuxt/schema/nuxt.schema.d.ts` can merge `NuxtConfig` as `{}` when only `appConfig` keys are customized; runtime config stays valid.
// Set early so nuxt-og-image resolves `nitro-prerender` compatibility instead of the unknown
// `github-pages` preset (the preset applies `static: true` after some module hooks run).
const isGithubPagesDeploy = process.env.DEPLOY_TARGET === 'github-pages';
export default defineNuxtConfig({
modules: [
'@nuxt/image',
'@nuxt/ui',
'@nuxt/content',
'nuxt-og-image',
'nuxt-llms',
'@nuxt/scripts',
'@tresjs/nuxt',
[
'@nuxtjs/google-fonts',
{
subsets: ['latin'],
families: {
'Geist+Mono': true,
},
},
],
],
devtools: {
enabled: true,
},
css: ['~/assets/css/main.css'],
content: {
build: {
markdown: {
toc: {
searchDepth: 1,
},
},
},
},
mdc: {
highlight: {
noApiRoute: false,
},
},
routeRules: {
'/': { prerender: true },
'/docs': { redirect: { statusCode: 301, to: '/docs/getting-started' } },
'/docs/contributing': {
redirect: { statusCode: 301, to: 'https://github.com/vercube/vercube/blob/main/CONTRIBUTING.md' },
},
'/docs/core-features': { redirect: { statusCode: 301, to: '/docs/core-features/configuration' } },
'/docs/modules': { redirect: { statusCode: 301, to: '/docs/modules/mcp' } },
'/docs/advanced': { redirect: { statusCode: 301, to: '/docs/advanced/custom-decorator' } },
'/docs/modules/web-sockets': { redirect: { statusCode: 301, to: '/docs/modules/web-sockets/overview' } },
'/docs/modules/auth': { redirect: { statusCode: 301, to: '/docs/modules/auth/overview' } },
'/docs/modules/storage': { redirect: { statusCode: 301, to: '/docs/modules/storage/overview' } },
'/docs/modules/logger': { redirect: { statusCode: 301, to: '/docs/modules/logger/overview' } },
'/docs/modules/serverless': { redirect: { statusCode: 301, to: '/docs/modules/serverless/overview' } },
'/docs/core/validation': { redirect: { statusCode: 301, to: '/docs/core-features/validation' } },
// Static hosting (GitHub Pages): docs must be prerendered so crawlers and OG validators get real
// HTML with meta tags. Client-only shells look “empty” to bots.
'/docs/**': { prerender: true },
// Fresh GitHub releases: keep SSR-only (no frozen HTML at build).
'/changelog': { prerender: false },
// nuxt-og-image browser renderer needs a real browser at build time; generate at runtime instead.
'/_og/**': { prerender: false },
// Crawled from /; some upstream docs AST breaks minimark stringify during static generation.
'/raw/**': { prerender: false },
},
compatibilityDate: '2025-10-01',
nitro: {
...(isGithubPagesDeploy ? { static: true } : {}),
prerender: {
// Seed docs so the crawler can follow sidebar/nav links to every page.
routes: ['/', '/docs/getting-started'],
crawlLinks: true,
autoSubfolderIndex: false,
// Nav includes parent paths without a markdown file (e.g. /docs/modules); crawlers still 404 those.
failOnError: false,
// IPX URLs are not static files; skip prerendering them (images use `none` provider on GitHub Pages).
ignore: ['/_ipx'],
},
},
icon: {
provider: 'iconify',
},
// GitHub Pages is static-only: there is no Nitro server for `/_ipx/*`. Use direct asset URLs when
// `DEPLOY_TARGET=github-pages` (set in deploy workflow). Local dev keeps default `ipx`.
image: {
provider: process.env.DEPLOY_TARGET === 'github-pages' ? 'none' : 'ipx',
},
llms: {
domain: 'https://vercube.dev/',
title: 'Vercube',
description: 'Unleash your server development with an ultra-efficient JavaScript framework',
full: {
title: 'Vercube - Full Documentation',
description: 'This is the full documentation for Vercube.',
},
},
ogImage: {
// v6: avoid exposing /_og/debug.json in production
debug: false,
},
});