-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
97 lines (89 loc) · 2.92 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
// https://nuxt.com/docs/api/configuration/nuxt-config
function setEnv( direct: string | undefined, defaultval = "", indirect: string | undefined = undefined, indirect_postfix: string = "") : string {
if (direct && direct.length > 0)
return direct
if (indirect && indirect.length > 0)
return indirect + indirect_postfix
return defaultval
}
function setEnvBool( envvar: string | undefined, defaultval: boolean | undefined = undefined ) : boolean {
if (envvar && envvar.length>0 && envvar.toLowerCase()!=="false")
return true
else
return defaultval ?? false
}
function setEnvUndefinedWhenEmpty( envvar: string | undefined ) :string | undefined {
if (envvar && envvar.length>0 && envvar.toLowerCase()!=="false")
return envvar
else
return undefined
}
export default defineNuxtConfig({
modules: [ '@nuxtjs/i18n', '@nuxtjs/tailwindcss', '@nuxtjs/color-mode', 'nuxt-umami' ],
i18n: {
strategy: 'prefix_except_default',
defaultLocale: 'de',
locales: [
{
code: "en",
file: "en.json",
name: "English"
},
{
code: "de",
file: "de.json",
name: "Deutsch"
}
],
lazy: true,
langDir: 'locales',
},
colorMode: {
preference: 'system', // default value of $colorMode.preference
fallback: 'light', // fallback value if not system preference found
classSuffix: '',
classPrefix: '',
},
// css: [ './assets/css/tailwind.css'
// ],
// app: {
// pageTransition: {
// name: 'page',
// mode: 'out-in'
// }
// },
umami: {
id: setEnv(process.env.NUXT_PUBLIC_UMAMI_ID,''),
host: setEnv(process.env.NUXT_PUBLIC_UMAMI_HOST,''),
autoTrack: true,
// proxy: 'cloak',
// useDirective: true,
// ignoreLocalhost: true,
// excludeQueryParams: false,
// domains: ['cool-site.app', 'my-space.site'],
// customEndpoint: '/my-custom-endpoint',
// enabled: false,
// logErrors: true,
},
runtimeConfig: {
public: {
url: process.env.NUXT_PUBLIC_URL,
appBase: setEnv(process.env.NUXT_PUBLIC_APP_BASE, 'http://localhost:3000', process.env.NUXT_PUBLIC_URL),
apiBase: setEnv(process.env.NUXT_PUBLIC_API_BASE, 'http://localhost:3003/api/', process.env.NUXT_PUBLIC_URL, "/api/") ,
mediaBase: setEnv(process.env.NUXT_PUBLIC_MEDIA_BASE, 'http://localhost:3003', process.env.NUXT_PUBLIC_URL),
skin: setEnv(process.env.NUXT_PUBLIC_SKIN,''),
logo: setEnv(process.env.NUXT_PUBLIC_LOGO, '/img/logo.png'),
logoDark: setEnv(process.env.NUXT_PUBLIC_LOGO_DARK, '/img/logo-w.png'),
enableDarkMode: setEnvUndefinedWhenEmpty(process.env.NUXT_PUBLIC_ENABLE_DARK_MODE),
umamiActive: setEnvBool(process.env.NUXT_PUBLIC_UMAMI_ID)
}
},
// nitro: {
// routeRules: {
// "/api/**": { proxy: 'localhost:3003' },
// "/s/**": { proxy: 'localhost:3003' }
// }
// },
devtools: { enabled: false },
compatibilityDate: '2024-11-16'
})