forked from unicovoit/unicovoit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
237 lines (213 loc) · 7.25 KB
/
nuxt.config.js
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
import colors from 'vuetify/lib/util/colors'
const PLAUSIBLE_DOMAIN = 'plausible.finxol.io'
const DESCRIPTION = 'Plateforme de covoiturage entre étudiants'
const TITLE = 'UniCovoit'
const DOMAIN = 'unicovoit.fr'
const URL = `https://${DOMAIN}`
const BANNER = `${URL}/icon.png`
const ADDOK_DOMAIN = "addok.unicovoit.fr"
const LANGUAGE = "fr-FR"
const AUTH0_ID = process.env.AUTH0_CLIENTID || 'no id'
const AUTH0_DOMAIN = process.env.AUTH0_DOMAIN || 'example.org'
const isProd = process.env.NODE_ENV === 'production'
export default {
telemetry: false,
// Enable scripts-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: true,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
titleTemplate: `%s | ${TITLE}`,
htmlAttrs: {
lang: LANGUAGE
},
contentLanguage: LANGUAGE,
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{hid: 'description', name: 'description', content: 'Plateforme de covoiturage entre étudiants'},
{name: 'format-detection', content: 'telephone=no'},
{
name: 'keywords',
content: 'covoiturage,blablacar,étudiant,dut informatique,dut,iutvannes,iut de vannes,iut vannes'
},
{name: 'author', content: 'finxol <[email protected]>'},
{name: 'language', content: 'French'},
{name: 'robots', content: 'index,follow'},
{name: 'category', content: 'internet'},
{hid: 'title', name: 'title', content: TITLE},
// Facebook
{property: 'og:type', content: 'website'},
{property: 'og:url', content: URL + '/'},
{hid: 'og:title', property: 'og:title', content: TITLE},
{hid: 'og:description', property: 'og:description', content: DESCRIPTION},
{property: 'og:image', content: BANNER},
// Twitter
{property: 'twitter:card', content: 'summary_large_image'},
{property: 'twitter:url', content: URL + '/'},
{hid: 'twitter:title', property: 'twitter:title', content: TITLE},
{hid: 'twitter:description', property: 'twitter:description', content: DESCRIPTION},
{property: 'twitter:image', content: BANNER}
],
link: [
{rel: 'icon', type: 'image/png', href: '/icon.png'}
]
},
loading: {color: "#4A6DD9"},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'@mdi/font/css/materialdesignicons.min.css',
'./assets/vuetify.css'
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Server Middleware
router: {
middleware: ['auth']
},
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
// https://go.nuxtjs.dev/vuetify
['@nuxtjs/vuetify', {iconfont: 'mdi'}],
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
// https://github.com/moritzsternemann/vue-plausible
'vue-plausible'
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://axios.nuxtjs.org/
'@nuxtjs/axios',
// https://www.npmjs.com/package/@nuxtjs/auth-next
'@nuxtjs/auth-next',
// https://www.npmjs.com/package/@nuxtjs/device
'@nuxtjs/device',
// https://www.npmjs.com/package/cookie-universal-nuxt
'cookie-universal-nuxt',
[
'@dansmaculotte/nuxt-security',
{
hsts: {
maxAge: 15552000,
includeSubDomains: true,
preload: true
},
referrer: 'same-origin',
additionalHeaders: true
}
],
// https://www.npmjs.com/package/@nuxt/content
"@nuxt/content"
],
auth: {
strategies: {
auth0: {
domain: AUTH0_DOMAIN,
clientId: AUTH0_ID,
audience: 'https://' + AUTH0_DOMAIN + '/api/v2/'
}
}
},
axios: {
https: isProd,
proxy: true
},
render: {
csp: {
hashAlgorithm: 'sha256',
policies: {
'default-src': ["'self'"],
'style-src': ["'self'", "'unsafe-inline'"],
'font-src': ["'self'"],
'script-src': ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
'img-src': ["'self'"],
'connect-src': ["'self'", "bano.addok.xyz", "send.pageclip.co", ADDOK_DOMAIN, PLAUSIBLE_DOMAIN, AUTH0_DOMAIN]
}
}
},
pwa: {
meta: {
title: TITLE,
author: 'finxol',
description: DESCRIPTION,
lang: 'fr',
ogSiteName: TITLE,
ogTitle: TITLE,
ogDescription: DESCRIPTION,
theme_color: '#ffffff'
},
manifest: {
name: TITLE,
short_name: TITLE,
description: DESCRIPTION,
lang: 'fr',
display: 'standalone'
},
workbox: {
cleanupOutdatedCaches: true
}
},
plausible: { // Use as fallback if no runtime config is available at runtime
domain: DOMAIN,
enableAutoPageviews: true,
enableAutoOutboundTracking: true
},
// Define runtime config
publicRuntimeConfig: {
plausible: {
domain: DOMAIN,
apiHost: 'https://' + PLAUSIBLE_DOMAIN,
enableAutoPageviews: true,
enableAutoOutboundTracking: true
},
pageclipUrl: process.env.PAGECLIP_URL || '',
pageclipKey: process.env.PAGECLIP_KEY || '',
isProd,
ADDOK_DOMAIN,
AUTH0_DOMAIN,
LANGUAGE
},
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
vuetify: {
customVariables: ['~assets/variables.sass'],
defaultAssets: false,
treeShake: true,
theme: {
disable: true
/*dark: false,
lang: {
current: 'fr'
},
themes: {
dark: {
primary: "#4A6DD9",
accent: colors.grey.darken3,
secondary: colors.grey.darken3,
info: "#03A9F4",
warning: colors.amber.accent3,
error: colors.red.darken3,
success: colors.green.darken2
},
light: {
primary: "#4A6DD9",
accent: colors.grey.base,
secondary: colors.grey.lighten4,
info: "#03A9F4",
warning: colors.amber.accent3,
error: colors.red.base,
success: colors.green.base
}
}*/
}
},
serverMiddleware: {
'/api': '~/api'
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
extractCSS: true
}
}