-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.js
156 lines (137 loc) · 4.36 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
import i18n from './src/locales'; // eslint-disable-line import/no-import-module-exports
import i18nEn from './src/locales/en'; // eslint-disable-line import/no-import-module-exports
module.exports = {
// Target: https://go.nuxtjs.dev/config-target
srcDir: 'src',
target: 'static',
ssr: false,
// Generate fallback pages: https://nuxtjs.org/docs/configuration-glossary/configuration-generate#fallback
generate: {
fallback: true,
},
server: {
host: '0.0.0.0',
},
// Environment variables
publicRuntimeConfig: {
app: {
mail: process.env.APP_MAIL || '[email protected]',
source: process.env.APP_SOURCE || 'https://github.com/lecoueyl/lecouey.me',
url: process.env.APP_URL || 'https://www.lecouey.me',
},
links: {
codepen: process.env.LINKS_CODEPEN || 'https://codepen.io/llecouey',
dribbble: process.env.LINKS_DRIBBBLE || 'https://dribbble.com/llecouey',
github: process.env.LINKS_GITHUB || 'https://github.com/lecoueyl',
linkedin: process.env.LINKS_LINKEDIN || 'https://www.linkedin.com/in/llecouey',
},
},
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: i18nEn.head.title,
titleTemplate: `%s — ${i18nEn.head.title}`,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'author', content: i18nEn.head.title },
{ name: 'description', content: i18nEn.head.description },
{ name: 'keywords', content: i18nEn.head.keywords },
{ name: 'robots', content: 'index, follow' },
{ name: 'googlebot', content: 'index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1' },
{ name: 'bingbot', content: 'index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1' },
{ name: 'msapplication-TileColor', content: '#fdfcfd' },
{ property: 'og:title', content: i18nEn.head.title },
{ property: 'og:description', content: i18nEn.head.description },
{ property: 'og:type', content: 'website' },
{ property: 'og:url', content: process.env.APP_URL },
{ property: 'og:image', content: `${process.env.APP_URL}/social.png` },
{ property: 'og:site_name', content: i18nEn.head.title },
{ name: 'twitter:card', content: 'summary' },
{ name: 'twitter:title', content: i18nEn.head.title },
{ name: 'twitter:description', content: i18nEn.head.description },
{ name: 'twitter:image', content: `${process.env.APP_URL}/social.png` },
{ name: 'twitter:site', content: process.env.TWITTER_ACCOUNT },
],
link: [
{
rel: 'apple-touch-icon',
sizes: '180x180',
href: '/apple-touch-icon.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/favicon-32x32.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/favicon-16x16.png',
},
{
rel: 'manifest',
href: '/site.webmanifest',
},
{
rel: 'mask-icon',
href: '/safari-pinned-tab.svg',
color: '#2b2b2b',
},
],
script: [
{
src: '/js/script.js',
async: true,
defer: true,
'data-domain': 'lecouey.me',
},
],
},
loading: false,
// Auto import components: https://go.nuxtjs.dev/config-components
components: [
{
path: '~/components',
ignore: ['**/index.js'],
},
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
['@nuxtjs/i18n', i18n],
'@nuxtjs/sitemap',
],
sitemap: {
hostname: process.env.APP_URL,
gzip: true,
i18n: i18n.defaultLocale,
},
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
'@nuxtjs/color-mode',
'@nuxtjs/stylelint-module',
'@nuxtjs/svg',
'@nuxtjs/tailwindcss',
],
colorMode: {
classSuffix: '',
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
publicPath: '/assets/',
extractCSS: true,
extend(config) {
// Load media assets
config.module.rules.push({
test: /\.(m4a|mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: '[name].[ext]?[hash]',
outputPath: './assets/media/',
},
});
},
},
};