-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathnuxt.config.ts
153 lines (136 loc) · 3.74 KB
/
nuxt.config.ts
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import { defineNuxtConfig } from 'nuxt/config'
import { $fetch } from 'ofetch'
import { isDevelopment } from 'std-env'
import NuxtScripts from '../src/module'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
extends: ['@nuxt/ui-pro'],
modules: [
'@nuxt/fonts',
'@vueuse/nuxt',
NuxtScripts,
'@nuxt/ui',
'@nuxtjs/seo',
'@nuxt/image',
'nuxt-content-twoslash',
'@nuxt/content',
'nuxt-llms',
async (_, nuxt) => {
// build time for caching
const { contributors } = await $fetch(`https://api.nuxt.com/modules/scripts`).catch(() => {
if (isDevelopment) {
return {
contributors: [],
}
}
throw new Error('Failed to fetch contributors')
})
nuxt.options.runtimeConfig.public.contributors = contributors.map(m => m.id)
},
],
$production: {
routeRules: {
'/api/_mdc/highlight': { cache: { group: 'mdc', name: 'highlight', maxAge: 60 * 60 } },
'/api/_content/query/**': { cache: { group: 'content', name: 'query', maxAge: 60 * 60 } },
'/api/_nuxt_icon': { cache: { group: 'icon', name: 'icon', maxAge: 60 * 60 * 24 * 7 } },
},
scripts: {
registry: {
plausibleAnalytics: {
domain: 'scripts.nuxt.com',
},
},
},
},
devtools: {
enabled: true,
},
site: {
name: 'Nuxt Scripts',
url: 'scripts.nuxt.com',
description: 'Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.',
},
content: {
build: {
markdown: {
highlight: {
theme: {
light: 'github-light',
default: 'github-light',
dark: 'material-theme-palenight',
},
langs: [
'ts',
'tsx',
'vue',
'json',
'html',
'bash',
'xml',
'diff',
'md',
'dotenv',
],
},
},
},
},
ui: {
icons: ['heroicons', 'ph', 'simple-icons'],
},
build: {
transpile: ['shiki'],
},
future: {
compatibilityVersion: 4,
},
compatibilityDate: '2024-07-03',
nitro: {
prerender: {
// For CF trailing slash issue
autoSubfolderIndex: false,
},
},
hooks: {
// Define `@nuxt/ui` components as global to use them in `.md` (feel free to add those you need)
'components:extend': (components) => {
const globals = components.filter(c => ['UButton', 'UIcon', 'UAlert'].includes(c.pascalName) || c.pascalName.includes('Prose'))
globals.forEach(c => c.global = true)
},
},
icon: {
clientBundle: {
scan: true,
includeCustomCollections: true,
},
provider: 'iconify',
},
llms: {
domain: 'https://scripts.nuxt.com',
title: 'Nuxt Scripts',
description: 'Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.',
notes: [
'The documentation only includes Nuxt Content v3 docs.',
'The content is automatically generated from the same source as the official documentation.',
],
full: {
title: 'Complete Documentation',
description: 'The complete documentation including all content',
},
},
ogImage: {
zeroRuntime: true,
},
seo: {
meta: {
googleSiteVerification: 'y3acjlg66w6e8QRmX-asCZv9EBpyLHdrhIKzdXJvqDg',
themeColor: [
{ content: '#18181b', media: '(prefers-color-scheme: dark)' },
{ content: 'white', media: '(prefers-color-scheme: light)' },
],
},
},
uiPro: {
license: process.env.NUXT_UI_PRO_LICENSE,
},
})