-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
175 lines (168 loc) · 3.92 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
import axios from 'axios'
const siteRoutes = function (callback) {
const token = 'bwir4B2SmD0WBu84SxDvrwtt'
const version = 'published'
// eslint-disable-next-line camelcase
let cache_version = 0
const toIgnore = ['home', 'en/settings']
const routes = ['/']
axios
.get(`https://api.storyblok.com/v1/cdn/spaces/me?token=${token}`)
// eslint-disable-next-line camelcase
// eslint-disable-next-line
.then(space_res => {
// timestamp of latest publish
// eslint-disable-next-line camelcase
cache_version = space_res.data.space.version
// Call for all Links using the Links API: https://www.storyblok.com/docs/Delivery-Api/Links
axios
// eslint-disable-next-line camelcase
.get(`https://api.storyblok.com/v1/cdn/links?token=${token}&version=${version}&cv=${cache_version}&per_page=100`
)
.then((res) => {
Object.keys(res.data.links).forEach((key) => {
if (!toIgnore.includes(res.data.links[key].slug)) {
routes.push('/' + res.data.links[key].slug)
}
})
callback(null, routes)
})
})
}
export default {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: 'Harbison Apps',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content: process.env.npm_package_description || ''
}
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
script: [
{ src: 'https://f.convertkit.com/ckjs/ck.5.js', defer: true, async: true }
]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#327a5a', height: '15px' },
/*
** Global CSS
*/
css: [],
/*
** Plugins to load before mounting the App
*/
plugins: ['~/plugins/vuelidate'],
/*
** Nuxt.js dev-modules
*/
buildModules: [
'@nuxtjs/svg',
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
// Doc: https://github.com/nuxt-community/nuxt-tailwindcss
'@nuxtjs/tailwindcss',
// Doc: https://github.com/nuxt-community/color-mode-module
'@nuxtjs/color-mode'
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/sitemap',
// '@nuxtjs/axios',
'@nuxtjs/pwa',
[
'nuxt-compress',
{
gzip: {
cache: true
},
brotli: {
threshold: 10240
}
}
],
[
'storyblok-nuxt',
{
accessToken:
process.env.NODE_ENV === 'production'
? 'bwir4B2SmD0WBu84SxDvrwtt'
: 'HyzhsjfQ5DFBvA14Bw7eDQtt',
cacheProvider: 'memory'
}
]
],
pwa: {
meta: {
title: 'Harbison Apps',
author: 'Harbison Apps'
},
manifest: {
name: 'Harbison Apps PWA',
short_name: 'Harbison Apps PWA',
lang: 'en',
start_url: '/'
},
workbox: {
offline: true,
preCaching: ['/'],
skipWaiting: true
}
},
sitemap: {
hostname: 'https://harbisonapps.netlify.app',
gzip: true,
routes: siteRoutes
},
purgeCSS: {
whitelist: [
'seva-form',
'formkit-form',
'formkit-background',
'formkit-subheader',
'formkit-alert',
'formkit-alert-error',
'seva-fields',
'formkit-fields',
'formkit-field',
'formkit-input',
'formkit-submit',
'formkit-guarantee',
'dark-mode'
]
},
tailwindcss: {
configPath: '~tailwind.config.js',
cssPath: '~/assets/css/tailwind.css',
exposeConfig: false
},
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
// axios: {},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend (config, ctx) {}
},
generate: {
routes: siteRoutes
}
}