-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
94 lines (92 loc) · 2.68 KB
/
nuxt.config.ts
File metadata and controls
94 lines (92 loc) · 2.68 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
// https://nuxt.com/docs/api/configuration/nuxt-config
import type { LocaleObject } from '@nuxtjs/i18n'
const processLocales = () => {
const locales = process.env.NUXT_PUBLIC_DATO_REGION_LOCALES
if (locales) {
const localeArray = locales?.split(',').map(l => l.trim())
return localeArray?.map((x) => {
return {
code: x,
file: x + '.js'
}
}) as LocaleObject[]
} else {
// If no region locales are defined - ensure that the default region is applied
const defaultLocale = process.env.NUXT_PUBLIC_DATO_DEFAULT_LOCALE
return [
{
code: defaultLocale,
file: defaultLocale + '.js'
}
] as LocaleObject[]
}
}
export default defineNuxtConfig({
ssr: false,
// devtools: {
// enabled: true,
// },
nitro: {
compressPublicAssets: {
brotli: true
}
},
app: {
head: {
link: [
{ rel: 'icon', type: 'image/png', href: '/favicon-32x32.png' },
{ rel: 'icon', type: 'image/png', href: '/favicon-196x196.png', sizes: '196x196' },
{ rel: 'icon', type: 'image/png', href: '/favicon-96x96.png', sizes: '96x96' },
{ rel: 'icon', type: 'image/png', href: '/favicon-32x32.png', sizes: '32x32' },
{ rel: 'icon', type: 'image/png', href: '/favicon-16x16.png', sizes: '16x16' },
{ rel: 'icon', type: 'image/png', href: '/favicon-128.png', sizes: '128x128' },
{ rel: 'dns-prefetch', href: 'https://www.googletagmanager.com' },
{ rel: 'dns-prefetch', href: 'https://hits-i.iubenda.com' },
{ rel: 'dns-prefetch', href: 'https://cdn.iubenda.com' },
{ rel: 'dns-prefetch', href: 'https://flagcdn.com' }
]
},
pageTransition: { name: 'page', mode: 'out-in' }
},
modules: [
'@nuxtjs/tailwindcss',
'@pinia/nuxt',
'nuxt-svgo',
'@nuxtjs/robots',
'@nuxtjs/i18n',
'nuxt-gtag',
'@vueuse/nuxt'
],
i18n: {
locales: processLocales(),
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
redirectOn: 'root' // recommended
},
defaultLocale: process.env.NUXT_PUBLIC_DATO_DEFAULT_LOCALE,
strategy: 'prefix',
lazy: true,
langDir: 'lang'
},
svgo: {
defaultImport: 'component'
},
runtimeConfig: {
REDIRECT_RULES: process.env.REDIRECT_RULES,
public: {
SUPA_KEY: process.env.SUPA_KEY,
DATO_TOKEN: process.env.DATO_TOKEN,
DATO_REGION_ID: process.env.DATO_REGION_ID,
DATO_DEFAULT_LOCALE: process.env.DATO_DEFAULT_LOCALE,
DATO_REGION_LOCALES: process.env.DATO_REGION_LOCALES,
IS_GLOBAL_SITE: process.env.IS_GLOBAL_SITE
}
},
typescript: {
typeCheck: true
},
imports: {
dirs: ['types/*.d.ts']
}
})