This repository has been archived by the owner on Jun 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnuxt.config.js
94 lines (93 loc) · 2.49 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
const { POPCORN_DIR } = process.env
require('dotenv').config({ path: POPCORN_DIR + '/.env' })
const { generateSocialShareHeadersMeta } = require('./services/helpers.js')
const popcorn = require('./popcorn.config.js')
const serveStatic = require('serve-static')
const path = require('path')
module.exports = {
mode: 'universal',
buildDir: popcorn.dirBuildPath,
// ces variables seront accessibles côté client comme côté serveur
env: {
POPCORN_BASE_URL: process.env.POPCORN_BASE_URL,
POPCORN_SLACK_WEBHOOK: process.env.POPCORN_SLACK_WEBHOOK,
POPCORN_LOCATION: popcorn.location,
POPCORN_SLOGAN: popcorn.slogan,
POPCORN_TITLE: popcorn.title,
POPCORN_SUBTITLE: popcorn.subtitle,
POPCORN_OG_DEFAULT_TITLE: popcorn.ogDefaultTitle,
POPCORN_OG_DEFAULT_DESCRIPTION: popcorn.ogDefaultDescription,
POPCORN_OG_DEFAULT_URL: popcorn.ogDefaultUrl,
POPCORN_OG_DEFAULT_IMAGE: popcorn.ogDefaultImage
},
css: ['@/static/css/bulma.min.css', '@/static/css/app.css'],
/*
** Headers of the page
*/
head: {
title: 'Popcorn',
htmlAttrs: {
lang: 'fr'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
name: 'description',
content: popcorn.ogDefaultDescription
},
...generateSocialShareHeadersMeta({
title: popcorn.ogDefaultTitle,
description: popcorn.ogDefaultDescription,
image: popcorn.ogDefaultImage,
url: popcorn.ogDefaultUrl
})
],
link: [
{
rel: 'stylesheet',
href: 'https://use.fontawesome.com/releases/v5.7.2/css/all.css'
}
]
},
/*
** Plugins to load before mounting the App
*/
plugins: ['~plugins/vue-lazyload'],
/*
** Nuxt.js modules
*/
modules: [
['@nuxtjs/dotenv', { path: POPCORN_DIR }],
'nuxt-gustave',
'nuxt-purgecss',
'~/modules/copyPublic.js'
],
purgeCSS: {
mode: 'postcss'
},
gustave: {
JSONDirectory: popcorn.dirApiPath,
compilers: [
'compilers/persons.js',
'compilers/pages.js',
'compilers/popcorns.js'
]
},
generate: {
dir: popcorn.dirDistPath
},
build: {
extend(config) {
// override and set some aliases
config.resolve.alias['@api'] = popcorn.dirApiPath
}
},
serverMiddleware: [
{
// servir les fichiers du dossier "public" pendant le dev
path: '/' + path.basename(popcorn.dirPublicPath),
handler: serveStatic(popcorn.dirPublicPath)
}
]
}