-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
nuxt.config.js
72 lines (70 loc) · 1.63 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
import { ANALYTICS_TRACKING_ID, head, manifest } from './config'
import helmet from 'helmet'
module.exports = {
ssr: false,
head,
manifest,
loading: '~/components/Loading.vue',
css: ['~assets/styles/reset.css', '~assets/styles/transitions.css'],
plugins: [
{ src: '~plugins/init.js', mode: 'client' },
{ src: '~plugins/lazy', mode: 'client' },
{ src: '~plugins/filters.js' },
{ src: '~plugins/firestore.js' },
],
modules: [
'@nuxtjs/sitemap',
'@nuxtjs/component-cache',
'@nuxtjs/pwa',
'@nuxtjs/toast',
'@nuxtjs/robots',
'cookie-universal-nuxt',
['@nuxtjs/google-analytics', { id: ANALYTICS_TRACKING_ID }],
],
toast: {
theme: 'bubble',
position: 'top-center',
singleton: true,
},
render: {
gzip: { level: 1 },
http2: { push: true },
static: {
maxAge: '1y',
},
bundleRenderer: {
shouldPreload: (file, type) => {
if (type === 'script') {
const ignoredRoutes = ['legal']
if (ignoredRoutes.some((r) => file.includes(r))) {
return false
}
}
return ['script', 'style', 'font'].includes(type)
},
},
},
serverMiddleware: [
helmet({
referrerPolicy: { policy: 'strict-origin-when-cross-origin' },
}),
],
build: {
app: 'app.[chunkhash].js',
chunk: '[name].[chunkhash].js',
extractCSS: true,
optimization: {
splitChunks: {
name: true,
},
},
},
sitemap: {
hostname: 'https://foodfire.info/',
path: '/sitemap.xml',
cacheTime: 1000 * 60 * 15,
gzip: true,
generate: false,
exclude: ['/my/**'],
},
}