-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
123 lines (121 loc) · 2.93 KB
/
nuxt.config.ts
File metadata and controls
123 lines (121 loc) · 2.93 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
117
118
119
120
121
122
123
import type { NitroRouteConfig } from 'nitropack'
import { defineNuxtConfig } from 'nuxt/config'
import { generatePrerenderRoutes } from './scripts/generate-routes'
export default async () => {
const prerenderRoutes = await generatePrerenderRoutes('./content')
const swrRoutes = ['/api/_content/packages.json', '/api/_content/releases.json']
return defineNuxtConfig({
sourcemap: false,
extends: ['shadcn-docs-nuxt'],
modules: [
'@nuxtjs/sitemap',
'motion-v/nuxt',
'@nuxt/eslint',
'nuxt-gtag',
],
devtools: { enabled: true },
app: {
head: {
meta: [
{ name: 'google-site-verification', content: 'hqPb74AFcL3IXb7yqjOcOY9v6MJkevvVm-IUSFc9GOk' },
],
script: [
{
innerHTML: `
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?32c126f9b300c6f3343505a50ca7a936";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
`,
type: 'text/javascript',
},
],
},
},
css: [
'~/assets/css/tailwind.css',
],
site: {
url: 'https://uni-helper.js.org/',
name: 'Uni Helper',
},
mdc: {
highlight: {
langs: ['jsonc', 'python'],
},
},
compatibilityDate: '2024-07-06',
nitro: {
prerender: {
crawlLinks: true,
},
routeRules: {
...prerenderRoutes.reduce((acc, route) => {
acc[route] = { isr: true, prerender: true }
return acc
}, {} as Record<string, NitroRouteConfig>),
...swrRoutes.reduce((acc, route) => {
acc[route] = { swr: true, prerender: true }
return acc
}, {} as Record<string, NitroRouteConfig>),
},
netlify: {
images: {
remote_images: [
'https://github.com/.*',
'https://img.shields.io/.*',
],
},
},
},
eslint: {
config: {
standalone: false,
nuxt: {
sortConfigKeys: true,
},
},
},
i18n: {
defaultLocale: 'zh',
locales: [
{
code: 'zh',
name: '简体中文',
language: 'zh-CN',
},
],
},
fonts: {
priority: ['bunny', 'fontsource', 'google'],
},
icon: {
provider: 'iconify',
serverBundle: 'remote',
},
image: {
domains: [
'github.com',
],
},
vite: {
optimizeDeps: {
include: ['motion-v', 'clsx', 'tailwind-merge', 'class-variance-authority', 'reka-ui', 'scule', 'dayjs', '@braintree/sanitize-url'],
},
},
gtag: {
id: 'G-249B95M763',
},
ogImage: {
fonts: [
'Noto+Sans+SC:400',
],
},
sitemap: {
zeroRuntime: true,
},
})
}