-
Notifications
You must be signed in to change notification settings - Fork 1
/
nuxt.config.js
234 lines (233 loc) · 7.89 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
import fs from 'fs'
import path from 'path'
const env = process.env.NODE_ENV
const envPath = path.resolve(process.cwd(), `.env.${env}`)
// const _defaultEnvPath = path.resolve(process.cwd(), '.env')
export default {
mode: 'universal',
ssr: true,
/*
** Headers of the page
*/
head: {
title: 'The Largest Android Developers\' Conference in Africa',
titleTemplate: 'droidconKe - %s',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Droidcon is a global conference focused on the engineering of Android applications. Droidcon provides a forum for developers to network with other developers, share techniques, announce apps and products, and to learn and teach.' },
{ hid: 'keywords', name: 'keywords', content: 'Android, Event, Conference, Meetup, droidCon, Kenya, KE, droidConKE, droidconke, Android254, Kotlin, Flutter, iOS' },
{ hid: 'og:description', property: 'description', content: 'Droidcon is a global conference focused on the engineering of Android applications. Droidcon provides a forum for developers to network with other developers, share techniques, announce apps and products, and to learn and teach.' },
{ hid: 'og:title', property: 'og:title', content: 'The Largest Android Developers\' Conference in Africa' },
{ hid: 'twitter:title', name: 'twitter:title', content: 'The Largest Android Developers\' Conference in Africa' },
{ hid: 'og:url', property: 'og:url', content: 'https://droidcon.co.ke' },
{ hid: 'twitter:url', name: 'twitter:url', content: 'https://droidcon.co.ke' },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:site', content: '@droidconke' },
{ name: 'twitter:creator', content: '@droidconke' },
{ property: 'og:site_name', content: 'droidconKe' },
{ hid: 'og:image', property: 'og:image', content: '/images/img.png' },
{ hid: 'twitter:image', name: 'twitter:image', content: '/images/img.png' },
{ hid: 'theme-color', name: 'theme-color', content: '#864F96' },
{ name: 'canonical', content: 'https://droidcon.co.ke' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', href: '/css/layout.css' },
{ rel: 'stylesheet', href: '/css/color/light.css', id: 'light-theme-css' },
{ rel: 'stylesheet', href: 'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', id: 'font-awesome-css' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Montserrat%3A100%2C300%2C500%2C700%2C900&display=swap&ver=6.0', id: 'montserrat-font' },
]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#864F96' },
/*
** Global CSS
*/
css: [
'normalize.css/normalize.css'
],
/*
** Plugins to load before mounting the App
*/
plugins: [
'~/plugins/axios',
{ src: '~/plugins/vue-countdown', mode: 'client' },
'~/plugins/vue-authenticate.client.js',
'~/plugins/vue-carousel.client.js',
'~/plugins/helpers.js',
'~/plugins/vue-toaster.client.js',
'~/plugins/eventBus.js'
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
// Doc: https://github.com/nuxt-community/nuxt-tailwindcss
'@nuxtjs/tailwindcss'
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
'@nuxtjs/pwa',
// Doc: https://github.com/nuxt-community/dotenv-module
['@nuxtjs/dotenv', { filename: fs.existsSync(envPath) ? `.env.${env}` : '.env', systemvars: true }],
'cookie-universal-nuxt',
'@nuxtjs/proxy',
'vue-social-sharing/nuxt'
],
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
proxy: true
},
proxy: {
'/api2/': {
target: 'https://iid.googleapis.com',
pathRewrite: { '^/api2/': '' },
secure: !process.env.ENV === 'development'
},
'/apis/': {
target: 'https://droidcon-erp.herokuapp.com/api/v1',// 'http://api.droidcon.test/v1',
pathRewrite: { '^/apis/': '' },
secure: !process.env.ENV === 'development'
}
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend (config, ctx) {
},
terser: {
terserOptions: {
compress: {
drop_console: true
}
}
}
},
router: {
linkExactActiveClass: 'active',
// linkActiveClass: 'active',
extendRoutes (routes, resolve) {
routes.push({
name: 'error-404',
path: '*',
component: resolve(__dirname, 'pages/errors/404.vue')
},
{
name: 'not-found',
path: '/not-found',
component: resolve(__dirname, 'pages/errors/404.vue')
},
{
name: 'error-500',
path: '/error',
component: resolve(__dirname, 'layouts/error.vue')
},
{
path: '/social_login/:provider',
component: resolve(__dirname, 'components/pages/auth/logged.vue')
})
}
},
pwa: {
workbox: {
cacheNames: {
prefix: 'dr',
precache: 'precache',
runtime: 'runtime'
},
config: {
debug: false
},
offlineAssets: [
'/images/sponsor-graph.svg',
'/favicon.ico',
'/images/NUMBERS.svg',
'/images/sponsor-graph.svg'
],
runtimeCaching: [
{
urlPattern: 'https://fonts.googleapis.com/.*',
handler: 'cacheFirst',
method: 'GET',
strategyOptions: { cacheableResponse: { statuses: [0, 200] } }
},
{
urlPattern: 'https://via.placeholder.com/*',
handler: 'cacheFirst',
method: 'GET',
strategyOptions: { cacheableResponse: { statuses: [0, 200] } }
},
{
urlPattern: 'https://sessionize.com/image*',
handler: 'cacheFirst',
method: 'GET',
strategyOptions: { cacheableResponse: { statuses: [0, 200] } }
},
{
urlPattern: 'https://lh3.googleusercontent.com/*',
handler: 'cacheFirst',
method: 'GET',
strategyOptions: { cacheableResponse: { statuses: [0, 200] } }
},
{
urlPattern: `${process.env.API_BASE_URL}/*`,
handler: 'staleWhileRevalidate',
method: 'GET',
strategyOptions: {
cacheableResponse: { statuses: [0, 200, 201] },
cacheExpiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 7 // 7 days
}
}
}
]
}
},
env: {
BASE_URL: process.env.BASE_URL,
API_BASE_URL: process.env.API_BASE_URL,
ORG_SLUG: process.env.ORG_SLUG,
EVENT_SLUG: process.env.EVENT_SLUG,
MESSAGING_TOPIC: process.env.MESSAGING_TOPIC,
API_KEY: process.env.API_KEY,
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
FIREBASE_API_KEY: process.env.FIREBASE_API_KEY,
FIREBASE_MESSAGE_ID: process.env.FIREBASE_MESSAGE_ID,
FIREBASE_PUBLIC_KEY: process.env.FIREBASE_PUBLIC_KEY,
FIREBASE_SERVER_KEY: process.env.FIREBASE_SERVER_KEY,
FIREBASE_APP_ID: process.env.FIREBASE_APP_ID
}
// publicRuntimeConfig: {
// baseUrl: process.env.BASE_URL,
// apiBaseUrl: process.env.API_BASE_URL,
// orgSlug: process.env.ORG_SLUG,
// eventSlug: process.env.EVENT_SLUG,
// messagingId: process.env.MESSAGING_TOPIC
// },
// privateRuntimeConfig: {
// apiKey: process.env.API_KEY,
// googleClientId: process.env.GOOGLE_CLIENT_ID,
// firebaseApiKey: process.env.FIREBASE_API_KEY,
// firebaseMessageId: process.env.FIREBASE_MESSAGE_ID,
// firebasePublicKey: process.env.FIREBASE_PUBLIC_KEY,
// firebaseServerKey: process.env.FIREBASE_SERVER_KEY,
// firebaseAppId: process.env.FIREBASE_APP_ID
// }
}