-
Notifications
You must be signed in to change notification settings - Fork 1
/
nuxt.config.js
161 lines (144 loc) · 4.16 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
const pkg = require('./package');
const disqusDomains = 'https://disqus.com https://*.disqus.com https://*.disquscdn.com';
module.exports = {
mode: 'universal',
/*
** Headers of the page
*/
head: {
htmlAttrs: {
lang: 'en'
},
title: 'Jelle Kralt · Personal Blog',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=5' },
{ hid: 'description', name: 'description', content: `Jelle Kralt's personal blog. Hi, I'm Jelle Kralt, a Front End Architect at CODEZILLA, currently working for Rabobank. I ❤️ everything to do with JavaScript, both in the browser and on Node.js.` },
{ name: 'twitter:card', content: 'summary' },
{ name: 'twitter:site', content: '@jellekralt' },
{ name: 'twitter:title', content: 'Jelle Kralt' },
{ name: 'twitter:description', content: `Jelle Kralt's personal blog. Hi, I'm Jelle Kralt, a Front End Architect at CODEZILLA, currently working for Rabobank. I ❤️ everything to do with JavaScript, both in the browser and on Node.js.` },
{ 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' },
{ name: 'theme-color', content: '#ffffff' }
],
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: '/manifest.json' },
{ rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#f7df1e' },
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: ['~/assets/scss/main.scss'],
/*
** Plugins to load before mounting the App
*/
plugins: [
'~plugins/filters.js',
'~plugins/ga.js'
],
/*
** Nuxt.js modules
*/
modules: [
'nuxt-helmet',
'@nuxtjs/font-awesome',
'@nuxtjs/pwa',
'@nuxtjs/axios',
'@nuxtjs/style-resources',
'@nuxtjs/robots'
],
/*
** Set style resources
*/
styleResources: {
scss: ['@/assets/scss/_variables.scss', '@/assets/scss/_mixins.scss']
},
/*
** Base URL configuration
*/
baseUrl: process.env.BASE_URL || 'http://localhost:3000',
/*
** Helmet configuration
*/
helmet: {
hidePoweredBy: true,
dnsPrefetchControl: true,
expectCt: true,
frameguard: true,
hsts: true,
ieNoOpen: true,
noCache: true,
noSniff: true,
permittedCrossDomainPolicies: true,
referrerPolicy: true,
xssFilter: true
},
render: {
csp: {
hashAlgorithm: 'sha256',
policies: {
'default-src': ["'self'"],
'style-src': ["'self'", "'unsafe-inline'", disqusDomains],
'script-src': ["'self'", "'unsafe-inline'", disqusDomains, 'https://www.google-analytics.com'],
'img-src': ["'self'", 'data:', disqusDomains, 'https://www.google-analytics.com'],
'frame-src': ["'self'", disqusDomains]
}
}
},
/*
** Robots.txt settings
*/
robots: {
UserAgent: '*',
Disallow: (req) => {
const isMainHost = req.headers.host === 'jellekralt.com';
return isMainHost ? '' : '/';
},
Sitemap: (req) => {
var proto = req.connection.encrypted ? 'https' : 'http';
proto = req.headers['x-forwarded-proto'] || proto;
return `${proto}://${req.headers.host}/sitemap.xml`;
}
},
/*
** Axios module configuration
*/
axios: {
// See https://github.com/nuxt-community/axios-module#options
proxy: true
},
/*
** Proxy configuration
*/
proxy: {
'/api': (process.env.NODE_ENV !== 'production' ? 'http://localhost:1337' : 'https://jellekralt-com.jellekralt.now.sh/'),
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
}
}