forked from kernoeb/PlanningSup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
286 lines (267 loc) · 8.82 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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
const { NODE_ENV = 'production' } = process.env
const isDev = NODE_ENV === 'development'
const TITLE = process.env.DEPLOY_TITLE || 'PlanningSup'
const DESCRIPTION = process.env.DEPLOY_DESCRIPTION || 'Un planning universitaire moderne réalisé par @kernoeb'
const KEYWORDS = process.env.DEPLOY_KEYWORDS || ['planning', 'planningedt', 'planninguniv', 'edt', 'emploi du temps', 'université', 'calendrier', 'universitaire', 'planningiut', 'planningiut.fr', 'edtuniv', 'planningapp', 'app planning', 'site planning', 'planning sup', 'planning iut', 'dut informatique', 'dut', 'iutvannes', 'iut de vannes', 'iut vannes'].join(',')
const PLAUSIBLE_DOMAIN = process.env.DEPLOY_PLAUSIBLE_DOMAIN || 'plausible.noewen.com'
const META_TITLE = process.env.DEPLOY_META_TITLE || `${TITLE} | Calendrier universitaire`
const DOMAIN = process.env.DEPLOY_DOMAIN || 'planningsup.app'
const URL = `https://${DOMAIN}`
const BANNER = `${URL}/banner.png`
export default {
telemetry: false,
ssr: true,
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
htmlAttrs: {
lang: 'fr'
},
title: TITLE,
meta: [
{ charset: 'utf-8' },
{ hid: 'apple-mobile-web-app-title', name: 'apple-mobile-web-app-title', content: TITLE },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: DESCRIPTION },
{ name: 'keywords', content: KEYWORDS },
{ name: 'author', content: 'kernoeb' },
{ name: 'language', content: 'French' },
{ name: 'robots', content: 'index,follow' },
{ name: 'category', content: 'internet' },
{ hid: 'title', name: 'title', content: META_TITLE },
// Facebook
{ property: 'og:type', content: 'website' },
{ property: 'og:url', content: URL + '/' },
{ hid: 'og:title', property: 'og:title', content: META_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: META_TITLE },
{ hid: 'twitter:description', property: 'twitter:description', content: DESCRIPTION },
{ property: 'twitter:image', content: BANNER }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
// Global CSS (https://go.nuxtjs.dev/config-css)
css: [
],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
{ src: '~/plugins/v-tooltip.js', mode: 'client' }
],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
/*
** Server Middleware
*/
serverMiddleware: [
{ path: '/api/v1', handler: '~/server/' }
],
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
// https://go.nuxtjs.dev/vuetify
'@nuxtjs/vuetify',
// https://github.com/nuxt-community/moment-module
'@nuxtjs/moment',
['@nuxtjs/google-fonts', {
display: 'swap',
families: {
Roboto: [100, 300, 400, 500, 700, 900]
}
}],
// https://github.com/moritzsternemann/vue-plausible
'vue-plausible'
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://www.npmjs.com/package/cookie-universal-nuxt
'cookie-universal-nuxt',
// https://axios.nuxtjs.org/
'@nuxtjs/axios',
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
// https://www.npmjs.com/package/@nuxtjs/component-cache
'@nuxtjs/component-cache',
// https://saintplay.github.io/vue-swatches/
'vue-swatches/nuxt',
[
'@dansmaculotte/nuxt-security',
{
hsts: {
maxAge: 15552000,
includeSubDomains: true,
preload: true
},
referrer: 'same-origin',
additionalHeaders: true
}
]
],
render: {
csp: {
hashAlgorithm: 'sha256',
policies: {
'default-src': ["'self'"],
'style-src': ["'self'", "'unsafe-inline'", 'fonts.googleapis.com'],
'font-src': ["'self'", 'fonts.googleapis.com', 'fonts.gstatic.com'],
'script-src': ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
'connect-src': ["'self'", PLAUSIBLE_DOMAIN]
}
}
},
pwa: {
meta: {
title: TITLE,
author: 'kernoeb',
description: DESCRIPTION,
lang: 'fr',
ogSiteName: TITLE,
ogTitle: TITLE,
ogDescription: DESCRIPTION
},
manifest: {
name: TITLE,
short_name: TITLE,
description: DESCRIPTION,
lang: 'fr',
display: 'standalone',
background_color: '#000000'
},
workbox: {
cleanupOutdatedCaches: true
}
},
moment: {
defaultLocale: 'fr',
locales: ['fr']
},
axios: {
proxy: true
},
plausible: { // Use as fallback if no runtime config is available at runtime
domain: DOMAIN,
enableAutoPageviews: true,
enableAutoOutboundTracking: true
},
publicRuntimeConfig: {
plausible: {
domain: DOMAIN,
apiHost: 'https://' + PLAUSIBLE_DOMAIN,
enableAutoPageviews: true,
enableAutoOutboundTracking: true
},
name: TITLE,
hideWeekends: process.env.HIDE_WEEKENDS !== 'false',
defaultPlanning: process.env.DEFAULT_PLANNING_ID || 'iutdevannes.butdutinfo.1ereannee.gr1a.gr1a1',
i18n: {
week: 'Semaine',
weeks: 'Semaines',
day: 'Jour',
month: 'Mois',
today: "Aujourd'hui",
error1: 'Bon y a eu un soucis.',
error2: 'Revient plus tard bg.',
chooseEdt: 'Plannings',
changeEdt: "Changer d'EDT",
changeTheme: 'Changer le thème',
offline: 'Hors connexion',
donate: 'Faire un don',
projectPage: 'Code source',
settings: 'Paramètres',
lightThemeMsg: 'Activer le thème clair',
lightThemeDesc: 'Idéal pour perdre la vue',
blocklist: 'Liste noire',
blocklistDesc: 'Cache les cours contenant le(s) mot(s)',
ui: 'Interface',
error_db: "Le serveur de l'université choisie est indisponible (ou en galère), voici une version sauvegardée datant du ",
error_db_only: 'Planning temporairement indisponible',
error_db_one: 'Au moins un planning temporairement indisponible',
error_saved: 'version sauvegardée du',
error_saved2: 'version sauvegardée',
error_db2: "Le serveur de l'université choisie est indisponible (ou en galère), voici une version sauvegardée.",
error_db_all: "Oups, aucun planning n'est disponible, désolé !",
close: 'Fermer',
distance: 'DISTANCIEL',
mode: 'Mode',
contact: 'Me contacter',
multiplePlannings: 'Multiples plannings',
reset: 'Tout désélectionner',
selection: 'Sélection',
searchPlanning: 'Rechercher un planning',
selectedPlannings: 'plannings sélectionnés',
colors: 'Couleurs des cours',
others: 'Autres',
amphi: 'Amphis',
types: {
td: 'Travaux dirigés',
tp: 'Travaux pratiques',
amphi: 'Amphithéâtre',
other: 'Les cours random'
}
}
},
// Vuetify module configuration (https://go.nuxtjs.dev/config-vuetify)
vuetify: {
treeShake: true,
defaultAssets: false,
customVariables: ['~/assets/variables.scss'],
optionsPath: './vuetify.options.js'
},
modern: NODE_ENV === 'production',
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
transpile: [
/^axios/
],
loaders: {
css: {
modules: false
}
},
extractCSS: true,
postcss: {
postcssOptions:
{
// disable postcss plugins in development
plugins: isDev
? {}
: {
'@fullhuman/postcss-purgecss': {
content: [
'components/**/*.vue',
'layouts/**/*.vue',
'pages/**/*.vue',
'plugins/**/*.js',
'node_modules/vuetify/src/**/*.ts'
],
styleExtensions: ['.css'],
safelist: {
standard: [
'body',
'html',
'nuxt-progress',
/progress-circular/,
/col-*/, // enable if using v-col for layout,
/swatches/,
/[a-z]+--text/
],
deep: [
/page-enter/,
/page-leave/,
/transition/
]
}
},
'css-byebye': {
rulesToRemove: [
/.*\.v-application--is-rtl.*/
]
}
}
}
}
}
}