-
Notifications
You must be signed in to change notification settings - Fork 3
/
nuxt.config.ts
86 lines (77 loc) · 1.91 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
import process from 'node:process'
import { consola } from 'consola'
import { prefetchQuery, siteQuery } from './queries'
const shouldPrerender = process.env.NITRO_PRERENDER_PAGES === 'true'
if (shouldPrerender) consola.info('Prerendering enabled')
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
// If you project doesn't require i18n, use the `without-i18n` branch instead:
// https://github.com/johannschopplich/cacao-kit-frontend/tree/chore/without-i18n
modules: ['@nuxtjs/i18n', '@unocss/nuxt', '@vueuse/nuxt', 'nuxt-kql'],
devtools: {
enabled: true,
},
runtimeConfig: {
public: {
siteUrl: '',
},
},
kql: {
auth: 'bearer',
prefetch: {
kirbyStatic: prefetchQuery,
// Currently only used to infer the type of the `site` query
kirbySite: siteQuery,
},
},
i18n: {
locales: [
{
code: 'en',
file: 'en.json',
},
{
code: 'de',
file: 'de.json',
},
],
defaultLocale: 'en',
lazy: true,
langDir: 'locales',
strategy: 'prefix',
compilation: {
strictMessage: false,
},
detectBrowserLanguage: {
useCookie: true,
redirectOn: 'root',
},
bundle: {
fullInstall: false,
dropMessageCompiler: true,
},
},
nitro: {
prerender: {
// Enable Nitro's crawler to prerender all pages (optional)
// If Kirby content changes, the frontend will have to be rebuilt
...(shouldPrerender && {
crawlLinks: shouldPrerender,
routes: ['/en'],
}),
},
},
vite: {
server: {
// This is only required for the `pnpm dev:tunnel` command
// to proxy Kirby requests, especially images
proxy: {
'/__kirby': {
target: process.env.KIRBY_BASE_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/__kirby/, ''),
},
},
},
},
})