-
Notifications
You must be signed in to change notification settings - Fork 292
/
Copy pathnuxt.config.ts
57 lines (50 loc) · 1.56 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
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
extends: '@nuxt/ui-pro',
modules: [
'@nuxt/image',
'@nuxt/content',
'@nuxt/fonts',
'@nuxt/ui',
'@nuxthq/studio',
'@vueuse/nuxt',
'@nuxtjs/plausible',
'nuxt-og-image',
],
devtools: { enabled: true },
colorMode: {
preference: 'dark',
},
routeRules: {
'/get-started': { redirect: { to: '/get-started/installation', statusCode: 301 } },
'/configuration': { redirect: { to: '/get-started/configuration', statusCode: 301 } },
'/providers/introduction': { redirect: { to: '/get-started/providers', statusCode: 301 } },
'/components/nuxt-img': { redirect: { to: '/usage/nuxt-img', statusCode: 301 } },
'/components/nuxt-picture': { redirect: { to: '/usage/nuxt-picture', statusCode: 301 } },
'/api/use-image': { redirect: { to: '/usage/use-image', statusCode: 301 } },
},
compatibilityDate: '2024-07-11',
nitro: {
// only for prerendering
serveStatic: true,
prerender: {
routes: ['/', '/api/search.json'],
autoSubfolderIndex: false,
},
},
hooks: {
// Related to https://github.com/nuxt/nuxt/pull/22558
// Adding all global components to the main entry
// To avoid lagging during page navigation on client-side
// Downside: bigger JS bundle
// With sync: 465KB, gzip: 204KB
// Without: 418KB, gzip: 184KB
'components:extend'(components) {
for (const comp of components) {
if (comp.global) {
comp.global = 'sync'
}
}
},
},
})