forked from hoppscotch/hoppscotch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
256 lines (256 loc) · 6.14 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
// Some helpful application constants.
// TODO: Use these when rendering the pages (rather than just for head/meta tags...)
export const meta = {
name: "Postwoman",
shortDescription: "API request builder",
description: "The Postwoman API request builder helps you create your requests faster, saving you precious time on your development."
};
// Sets the base path for the router.
// Important for deploying to GitHub pages.
// -- Travis includes the author in the repo slug,
// so if there's a /, we need to get everything after it.
let repoName = (process.env.TRAVIS_REPO_SLUG || '').split('/').pop();
export const routerBase = process.env.DEPLOY_ENV === 'GH_PAGES' ? {
router: {
base: `/${repoName}/`
}
} : {
router: {
base: '/'
}
};
export default {
mode: 'spa',
/*
** Headers of the page
*/
head: {
title: `${meta.name} \u2022 ${meta.shortDescription}`,
meta: [
{
charset: 'utf-8'
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1, minimum-scale=1, shrink-to-fit=no, minimal-ui'
},
{
hid: 'description',
name: 'description',
content: meta.description || ''
},
{
name: 'keywords',
content: 'postwoman, postwoman chrome, postwoman online, postwoman for mac, postwoman app, postwoman for windows, postwoman google chrome, postwoman chrome app, get postwoman, postwoman web, postwoman android, postwoman app for chrome, postwoman mobile app, postwoman web app, api, request, testing, tool, rest, websocket'
},
{
name: 'X-UA-Compatible',
content: "IE=edge, chrome=1"
},
{
itemprop: "name",
content: `${meta.name} \u2022 ${meta.shortDescription}`
},
{
itemprop: "description",
content: meta.description
},
{
itemprop: "image",
content: `${routerBase.router.base}icons/icon-192x192.png`
},
// Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
{
name: 'application-name',
content: meta.name
},
// Add to homescreen for Safari on iOS
{
name: 'apple-mobile-web-app-capable',
content: 'yes'
},
{
name: 'apple-mobile-web-app-status-bar-style',
content: 'black-translucent'
},
{
name: 'apple-mobile-web-app-title',
content: meta.name
},
// Windows phone tile icon
{
name: 'msapplication-TileImage',
content: `${routerBase.router.base}icons/icon-144x144.png`
},
{
name: 'msapplication-TileColor',
content: '#282a36'
},
{
name: 'msapplication-tap-highlight',
content: 'no'
},
// OpenGraph
{
property: 'og:site_name',
content: meta.name
},
{
property: 'og:url',
content: 'https://postwoman.io'
},
{
property: 'og:type',
content: 'website'
},
{
property: 'og:title',
content: `${meta.name} \u2022 ${meta.shortDescription}`
},
{
property: 'og:description',
content: meta.description
},
{
property: 'og:image',
content: `${routerBase.router.base}icons/icon-144x144.png`
},
// Twitter
{
name: 'twitter:card',
content: "summary"
},
{
name: 'twitter:site',
content: "@liyasthomas"
},
{
name: 'twitter:creator',
content: "@liyasthomas"
},
{
name: 'twitter:url',
content: "https://postwoman.io"
},
{
name: 'twitter:title',
content: meta.name
},
{
name: 'twitter:description',
content: meta.shortDescription
},
{
name: 'twitter:image',
content: `${routerBase.router.base}icons/icon-144x144.png`
},
],
link: [
{
rel: 'icon',
type: 'image/x-icon',
href: `${routerBase.router.base}favicon.ico`
},
// Home-screen icons (iOS)
{
rel: 'apple-touch-icon',
href: `${routerBase.router.base}icons/icon-48x48.png`
},
{
rel: 'apple-touch-icon',
sizes: '72x72',
href: `${routerBase.router.base}icons/icon-72x72.png`
},
{
rel: 'apple-touch-icon',
sizes: '96x96',
href: `${routerBase.router.base}icons/icon-96x96.png`
},
{
rel: 'apple-touch-icon',
sizes: '144x144',
href: `${routerBase.router.base}icons/icon-144x144.png`
},
{
rel: 'apple-touch-icon',
sizes: '192x192',
href: `${routerBase.router.base}icons/icon-192x192.png`
},
]
},
/*
** Customize the progress-bar color
*/
loading: {
color: 'var(--ac-color)'
},
/*
** Global CSS
*/
css: [
'@/assets/css/themes.scss',
'@/assets/css/fonts.scss',
'@/assets/css/styles.scss'
],
/*
** Plugins to load before mounting the App
*/
plugins: [
{
src: '~/plugins/vuex-persist'
}
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
],
/*
** Nuxt.js modules
*/
modules: [
// See https://goo.gl/OOhYW5
['@nuxtjs/pwa', {
manifest: {
name: meta.name,
short_name: meta.name,
description: meta.shortDescription,
display: "standalone",
theme_color: "#282a36",
background_color: "#282a36",
start_url: `${routerBase.router.base}`,
icons: ((sizes) => {
let icons = [];
for (let size of sizes) {
icons.push({
"src": `${routerBase.router.base}icons/icon-${size}x${size}.png`,
"type": "image/png",
"sizes": `${size}x${size}`
});
}
return icons;
})([48, 72, 96, 144, 192, 512])
}
}],
['@nuxtjs/axios']
],
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {}
},
/*
** Generate configuration
*/
generate: {
fallback: true
},
/*
** Router configuration
*/
...routerBase
}