-
Notifications
You must be signed in to change notification settings - Fork 253
/
nuxt.config.ts
60 lines (60 loc) · 1.68 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
// 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'
},
ui: {
icons: ['heroicons', 'simple-icons', 'ph'],
},
fontMetrics: {
fonts: ['DM Sans'],
},
googleFonts: {
display: 'swap',
download: true,
families: {
'DM+Sans': [400, 500, 600, 700],
},
},
nitro: {
prerender: {
routes: ['/api/search.json'],
autoSubfolderIndex: false
}
},
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 } },
},
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'
}
}
}
}
})