-
Notifications
You must be signed in to change notification settings - Fork 1
/
nuxt.config.ts
113 lines (104 loc) · 3.2 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
// Global page headers: https://go.nuxtjs.dev/config-head
// head: {},
// `head` is defined in layouts/default.vue because if we do it here, nuxt-matomo does not work
// See https://github.com/nuxt-community/i18n-module/issues/1266#issuecomment-982527874
css: [
'~/assets/css/variables.css',
'~/assets/css/typography.css',
'~/assets/css/main.css',
'~/assets/css/forms.css',
'@fortawesome/fontawesome-svg-core/styles.css',
],
postcss: {
plugins: {
'postcss-custom-media': {},
},
},
components: [
{
path: '~/components',
pathPrefix: false,
},
],
modules: [
'@pinia/nuxt',
'@nuxtjs/i18n',
'@vueuse/nuxt',
'radix-vue/nuxt',
'@nuxt/eslint',
'@nuxtjs/stylelint-module',
'nuxt-mail',
],
i18n: {
locales: [
{ code: 'fr', iso: 'fr', name: 'FR', file: 'fr.json' },
{ code: 'de', iso: 'de', name: 'DE', file: 'de.json' },
],
baseUrl: process.env.ST_WEBSITE_BASE_URL,
defaultLocale: 'fr',
langDir: 'locales/',
// TODO: Switch to `prefix_and_default` if it works properly (e.g. when it won't add `/fr/` when it was not present before)
strategy: 'prefix_except_default',
lazy: true,
detectBrowserLanguage: {
useCookie: false,
},
vueI18n: './i18n.config.ts',
},
// nuxt-mail module configuration: https://github.com/dword-design/nuxt-mail#usage
// @ts-expect-error Module is missing TypeScript support
mail: {
message: {
to: process.env.ST_CONTACT_EMAIL_RECIPIENT,
from: `Swiss Tchoukball <no-reply@tchoukball.ch>`,
},
smtp: {
host: process.env.ST_SMTP_HOST,
port: process.env.ST_SMTP_PORT,
auth: {
user: process.env.ST_SMTP_USER,
pass: process.env.ST_SMTP_PASSWORD,
},
},
},
build: {
transpile: ['@fortawesome/vue-fontawesome'],
},
vue: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('swiper-'),
},
},
routeRules: {
'/championnat': { redirect: '/competitions/ligue-a' },
'/championnat-feminin': { redirect: '/competitions/championnat-feminin' },
'/coupesuisse': { redirect: '/competitions/coupe-suisse' },
'/staff': { redirect: '/structure' },
'/wtc2023': { redirect: '/equipes-nationales/competitions/wtc2023' },
'/wytc2023': { redirect: '/equipes-nationales/competitions/wytc2023' },
'/etc2022': { redirect: '/equipes-nationales/competitions/etc2022' },
},
runtimeConfig: {
public: {
cmsURL: process.env.CMS_URL || 'http://localhost:8055',
websiteBaseUrl: process.env.ST_WEBSITE_BASE_URL,
leveradeURL: 'https://api.leverade.com',
hCaptchaSiteKey: process.env.HCAPTCHA_SITE_KEY,
matomo: {
siteId: process.env.MATOMO_SITE_ID,
url: 'https://analytics.tchoukball.ch',
debug: process.env.MATOMO_DEBUG,
},
flickr: {
userId: '128998613@N07',
// It's okay to use the API key from the browser
// https://github.com/flickr/flickr-sdk#browser-usage
apiKey: process.env.FLICKR_API_KEY,
},
},
},
compatibilityDate: '2024-08-31',
});