forked from hoppscotch/hoppscotch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
342 lines (319 loc) · 8.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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
// Common options
export const options = {
name: "Hoppscotch",
shortDescription: "A free, fast and beautiful API request builder",
description: "Helps you create requests faster, saving precious time on development.",
loading: {
color: "var(--ac-color)",
background: "var(--bg-color)",
},
app: {
background: "#202124",
},
social: {
twitter: "@liyasthomas",
},
}
export default {
// Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
ssr: false,
// Target (https://go.nuxtjs.dev/config-target)
target: "static",
// Default: localhost
server: {
host: "0.0.0.0",
},
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
title: `${options.name} • ${options.shortDescription}`,
meta: [
{
name: "keywords",
content:
"hoppscotch, hopp scotch, hoppscotch online, hoppscotch app, 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, sse, graphql, socketio",
},
{
name: "X-UA-Compatible",
content: "IE=edge, chrome=1",
},
{
itemprop: "name",
content: `${options.name} • ${options.shortDescription}`,
},
{
itemprop: "description",
content: options.description,
},
{
itemprop: "image",
content: `${process.env.BASE_URL}banner.jpg`,
},
{
property: "og:image",
content: `${process.env.BASE_URL}banner.jpg`,
},
// Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
{
name: "application-name",
content: options.name,
},
// Windows phone tile icon
{
name: "msapplication-TileImage",
content: `/icon.png`,
},
{
name: "msapplication-TileColor",
content: options.app.background,
},
{
name: "msapplication-tap-highlight",
content: "no",
},
],
},
// Customize the progress-bar color (https://nuxtjs.org/api/configuration-loading/#customizing-the-progress-bar)
loading: {
color: options.loading.color,
continuous: true,
},
// Customize the loading indicator (https://nuxtjs.org/api/configuration-loading-indicator)
loadingIndicator: {
name: "pulse",
color: options.loading.color,
background: options.loading.background,
},
// Global CSS (https://go.nuxtjs.dev/config-css)
css: ["~/assets/scss/styles.scss", "~/assets/scss/themes.scss", "~/assets/scss/fonts.scss"],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: ["~/plugins/vuex-persist", "~/plugins/v-tooltip"],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
// https://github.com/nuxt-community/pwa-module
"@nuxtjs/pwa",
// https://github.com/nuxt-community/analytics-module
"@nuxtjs/google-analytics",
// https://github.com/nuxt-community/gtm-module
"@nuxtjs/gtm",
// https://github.com/nuxt-community/svg-module
"@nuxtjs/svg",
// https://github.com/nuxt-community/nuxt-tailwindcss
"@nuxtjs/tailwindcss",
// https://github.com/nuxt-community/color-mode-module
"@nuxtjs/color-mode",
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://github.com/nuxt-community/axios-module
"@nuxtjs/axios",
// https://github.com/nuxt-community/modules/tree/master/packages/toast
"@nuxtjs/toast",
// https://github.com/nuxt-community/i18n-module
"nuxt-i18n",
// https://github.com/nuxt-community/robots-module
"@nuxtjs/robots",
// https://github.com/nuxt-community/sitemap-module
"@nuxtjs/sitemap",
],
// PWA module configuration (https://pwa.nuxtjs.org/setup)
pwa: {
meta: {
ogHost: process.env.BASE_URL,
twitterCard: "summary_large_image",
twitterSite: options.social.twitter,
twitterCreator: options.social.twitter,
description: options.shortDescription,
theme_color: options.app.background,
},
manifest: {
name: options.name,
short_name: options.name,
description: options.shortDescription,
start_url: "/",
background_color: options.app.background,
theme_color: options.app.background,
},
},
// Toast module configuration (https://github.com/nuxt-community/modules/tree/master/packages/toast)
toast: {
position: "bottom-center",
duration: 3000,
theme: "bubble",
keepOnHover: true,
},
// Google Analytics module configuration (https://github.com/nuxt-community/analytics-module)
googleAnalytics: {
id: process.env.GA_ID,
},
// Google Tag Manager module configuration (https://github.com/nuxt-community/gtm-module)
gtm: {
id: process.env.GTM_ID,
},
// Sitemap module configuration (https://github.com/nuxt-community/sitemap-module)
sitemap: {
hostname: process.env.BASE_URL || "https://hoppscotch.io/",
},
// Robots module configuration (https://github.com/nuxt-community/robots-module)
robots: {
UserAgent: "*",
Disallow: "",
Allow: "/",
Sitemap: `${process.env.BASE_URL}sitemap.xml`,
},
// Color Mode module configuration (https://github.com/nuxt-community/color-mode-module)
colorMode: {
classSuffix: "",
preference: "dark",
fallback: "dark",
},
// i18n module configuration (https://github.com/nuxt-community/i18n-module)
i18n: {
locales: [
{
code: "en",
name: "English",
iso: "en-US",
file: "en-US.json",
},
{
code: "es",
name: "Español",
iso: "es-ES",
file: "es-ES.json",
},
{
code: "fr",
name: "Français",
iso: "fr-FR",
file: "fr-FR.json",
},
{
code: "fa",
name: "Farsi",
iso: "fa-IR",
file: "fa-IR.json",
},
{
code: "pt",
name: "Português",
iso: "pt-PT",
file: "pt-PT.json",
},
{
code: "pt-br",
name: "Português Brasileiro",
iso: "pt-BR",
file: "pt-BR.json",
},
{
code: "cn",
name: "简体中文",
iso: "zh-CN",
file: "zh-CN.json",
},
{
code: "tw",
name: "繁體中文",
iso: "zh-TW",
file: "zh-TW.json",
},
{
code: "id",
name: "Bahasa Indonesia",
iso: "id-ID",
file: "id-ID.json",
},
{
code: "tr",
name: "Türkçe",
iso: "tr-TR",
file: "tr-TR.json",
},
{
code: "de",
name: "Deutsch",
iso: "de-DE",
file: "de-DE.json",
},
{
code: "ja",
name: "日本語",
iso: "ja-JP",
file: "ja-JP.json",
},
{
code: "ko",
name: "한국어",
iso: "ko-KR",
file: "ko-KR.json",
},
{
code: "bn",
name: "Bengali",
iso: "bn-BD",
file: "bn-BD.json",
},
{
code: "ml",
name: "Malayalam",
iso: "ml-ML",
file: "ml-ML.json",
},
{
code: "vi",
name: "Vietnamese",
iso: "vi-VN",
file: "vi-VN.json",
},
],
defaultLocale: "en",
vueI18n: {
fallbackLocale: "en",
},
lazy: true,
langDir: "lang/",
detectBrowserLanguage: {
alwaysRedirect: true,
fallbackLocale: "en",
},
},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
// You can extend webpack config here
extend(config, ctx) {
// Sets webpack's mode to development if `isDev` is true.
if (ctx.isDev) {
config.mode = "development"
}
config.node = {
fs: "empty",
}
},
parallel: true,
cache: true,
// hardSource: true,
},
// Generate configuration (https://nuxtjs.org/api/configuration-generate)
generate: {
fallback: true,
},
// Public runtime configuration (https://nuxtjs.org/guide/runtime-config)
publicRuntimeConfig: {
GA_ID: process.env.GA_ID || "UA-61422507-4",
GTM_ID: process.env.GTM_ID || "GTM-NMKVBMV",
BASE_URL: process.env.BASE_URL || "https://hoppscotch.io/",
},
// Private runtime configuration (https://nuxtjs.org/guide/runtime-config)
privateRuntimeConfig: {
API_KEY: process.env.API_KEY,
AUTH_DOMAIN: process.env.AUTH_DOMAIN,
DATABASE_URL: process.env.DATABASE_URL,
PROJECT_ID: process.env.PROJECT_ID,
STORAGE_BUCKET: process.env.STORAGE_BUCKET,
MESSAGING_SENDER_ID: process.env.MESSAGING_SENDER_ID,
APP_ID: process.env.APP_ID,
MEASUREMENT_ID: process.env.MEASUREMENT_ID,
},
}