api-client/nuxt.config.js

322 lines
7.5 KiB
JavaScript
Raw Normal View History

2019-08-24 03:06:57 +00:00
// Some helpful application constants.
// TODO: Use these when rendering the pages (rather than just for head/meta tags...)
2020-03-24 02:19:09 +00:00
export const options = {
2020-08-13 11:20:02 +00:00
name: "Hoppscotch",
shortDescription: "A free, fast and beautiful API request builder",
description: "Helps you create requests faster, saving precious time on development.",
2020-03-24 07:06:37 +00:00
loading: {
2020-09-22 17:06:37 +00:00
color: "var(--ac-color)",
background: "var(--bg-color)",
2020-08-13 11:20:02 +00:00
},
app: {
background: "#202124",
},
social: {
twitter: "@liyasthomas",
2020-03-24 07:06:37 +00:00
},
2020-02-24 18:44:50 +00:00
}
2019-08-24 03:06:57 +00:00
export default {
2020-09-22 17:06:37 +00:00
ssr: false,
server: {
host: "0.0.0.0", // default: localhost
},
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Headers of the page
*/
2019-08-24 03:06:57 +00:00
head: {
2020-06-21 05:56:19 +00:00
title: `${options.name}${options.shortDescription}`,
2019-11-28 15:11:52 +00:00
meta: [
2019-09-04 06:49:17 +00:00
{
name: "keywords",
2019-11-28 15:11:52 +00:00
content:
2020-08-13 11:20:02 +00:00
"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",
2019-09-04 06:49:17 +00:00
},
{
name: "X-UA-Compatible",
content: "IE=edge, chrome=1",
2019-09-04 06:49:17 +00:00
},
{
itemprop: "name",
2020-06-21 05:56:19 +00:00
content: `${options.name}${options.shortDescription}`,
2019-09-04 06:49:17 +00:00
},
{
itemprop: "description",
2020-03-24 02:19:09 +00:00
content: options.description,
2019-09-04 06:49:17 +00:00
},
{
itemprop: "image",
2020-08-23 11:17:48 +00:00
content: `${process.env.BASE_URL}banner.jpg`,
2019-09-04 06:49:17 +00:00
},
2020-03-24 07:41:11 +00:00
{
property: "og:image",
2020-08-23 11:17:48 +00:00
content: `${process.env.BASE_URL}banner.jpg`,
2020-03-24 07:41:11 +00:00
},
2019-08-24 03:06:57 +00:00
// Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
2019-09-04 06:49:17 +00:00
{
name: "application-name",
2020-03-24 02:19:09 +00:00
content: options.name,
2019-09-04 06:49:17 +00:00
},
2019-08-24 03:06:57 +00:00
// Windows phone tile icon
2019-09-04 06:49:17 +00:00
{
name: "msapplication-TileImage",
2020-08-23 11:33:49 +00:00
content: `/icon.png`,
2019-09-04 06:49:17 +00:00
},
{
name: "msapplication-TileColor",
2020-08-13 11:20:02 +00:00
content: options.app.background,
2019-09-04 06:49:17 +00:00
},
{
name: "msapplication-tap-highlight",
content: "no",
2019-09-04 06:49:17 +00:00
},
2019-08-24 03:06:57 +00:00
],
2019-11-28 15:11:52 +00:00
link: [
2019-09-04 06:49:17 +00:00
{
rel: "apple-touch-icon",
2020-08-23 11:33:49 +00:00
href: "/icon.png",
2019-09-04 06:49:17 +00:00
},
{
2020-08-13 11:20:02 +00:00
rel: "apple-touch-startup-image",
2020-08-23 11:33:49 +00:00
href: "/icon.png",
2020-02-24 18:44:50 +00:00
},
],
2019-08-24 03:06:57 +00:00
},
/*
2019-09-04 06:49:17 +00:00
** Customize the progress-bar color
*/
loading: {
2020-09-22 17:06:37 +00:00
color: options.loading.color,
2020-03-05 01:18:10 +00:00
continuous: true,
2019-09-04 06:49:17 +00:00
},
2019-10-11 08:53:07 +00:00
/*
** Customize the loading indicator
*/
loadingIndicator: {
name: "pulse",
2020-08-13 11:20:02 +00:00
color: options.loading.color,
background: options.loading.background,
2019-10-11 08:53:07 +00:00
},
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Global CSS
*/
2020-09-22 17:06:37 +00:00
css: ["~/assets/scss/styles.scss", "~/assets/scss/themes.scss", "~/assets/scss/fonts.scss"],
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Plugins to load before mounting the App
*/
2020-08-13 11:20:02 +00:00
plugins: ["~/plugins/vuex-persist", "~/plugins/v-tooltip"],
/*
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
components: true,
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Nuxt.js dev-modules
*/
buildModules: [
2020-08-13 11:20:02 +00:00
// https://pwa.nuxtjs.org
"@nuxtjs/pwa",
// Doc: https://github.com/nuxt-community/analytics-module
"@nuxtjs/google-analytics",
// Doc: https://github.com/nuxt-community/gtm-module
"@nuxtjs/gtm",
// Doc: https://github.com/nuxt-community/svg-module
"@nuxtjs/svg",
2020-09-22 17:06:37 +00:00
// Doc: https://tailwindcss.nuxtjs.org
"@nuxtjs/tailwindcss",
// Doc: https://color-mode.nuxtjs.org
"@nuxtjs/color-mode",
],
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Nuxt.js modules
*/
2019-08-24 03:06:57 +00:00
modules: [
2020-08-13 11:20:02 +00:00
// https://axios.nuxtjs.org
2020-05-10 06:40:17 +00:00
"@nuxtjs/axios",
// https://github.com/nuxt-community/modules/tree/master/packages/toast
2020-05-10 06:40:17 +00:00
"@nuxtjs/toast",
// Doc: https://github.com/nuxt-community/nuxt-i18n
"nuxt-i18n",
// Doc: https://github.com/nuxt-community/robots-module
2020-05-10 06:40:17 +00:00
"@nuxtjs/robots",
2020-08-13 11:20:02 +00:00
// Doc: https://github.com/nuxt-community/sitemap-module
"@nuxtjs/sitemap",
2019-08-24 03:06:57 +00:00
],
2019-09-29 13:21:43 +00:00
pwa: {
meta: {
2020-08-13 11:20:02 +00:00
ogHost: process.env.BASE_URL,
2020-03-24 07:06:37 +00:00
twitterCard: "summary_large_image",
2020-08-13 11:20:02 +00:00
twitterSite: options.social.twitter,
twitterCreator: options.social.twitter,
2020-03-24 02:19:09 +00:00
description: options.shortDescription,
2020-08-13 11:20:02 +00:00
theme_color: options.app.background,
2019-09-29 13:21:43 +00:00
},
2020-08-23 11:33:49 +00:00
manifest: {
name: options.name,
short_name: options.name,
description: options.shortDescription,
start_url: "/",
background_color: options.app.background,
theme_color: options.app.background,
},
2019-09-29 13:21:43 +00:00
},
2019-09-28 09:33:16 +00:00
toast: {
position: "bottom-center",
duration: 3000,
theme: "bubble",
2020-02-24 18:44:50 +00:00
keepOnHover: true,
2019-09-28 09:33:16 +00:00
},
googleAnalytics: {
id: process.env.GA_ID,
2019-09-28 09:33:16 +00:00
},
2020-03-24 02:19:09 +00:00
gtm: {
id: process.env.GTM_ID,
2020-03-24 02:19:09 +00:00
},
sitemap: {
2020-08-30 05:51:42 +00:00
hostname: process.env.BASE_URL || "https://hoppscotch.io/",
},
2019-11-03 06:06:41 +00:00
robots: {
UserAgent: "*",
Disallow: "",
Allow: "/",
2020-08-13 11:20:02 +00:00
Sitemap: `${process.env.BASE_URL}sitemap.xml`,
2019-11-03 06:06:41 +00:00
},
2020-09-24 02:52:54 +00:00
colorMode: {
classSuffix: "",
preference: "dark",
fallback: "dark",
},
2019-11-27 08:45:11 +00:00
i18n: {
2019-11-28 15:11:52 +00:00
locales: [
{
code: "en",
name: "English",
iso: "en-US",
2020-03-12 02:17:59 +00:00
file: "en-US.json",
2019-11-27 08:45:11 +00:00
},
{
code: "es",
name: "Español",
iso: "es-ES",
2020-03-12 02:17:59 +00:00
file: "es-ES.json",
2019-11-27 15:49:59 +00:00
},
{
code: "fr",
name: "Français",
iso: "fr-FR",
2020-03-12 02:17:59 +00:00
file: "fr-FR.json",
2019-11-27 17:33:02 +00:00
},
{
code: "fa",
name: "Farsi",
iso: "fa-IR",
2020-03-12 02:17:59 +00:00
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",
2020-03-12 02:17:59 +00:00
file: "pt-BR.json",
2019-11-28 01:38:31 +00:00
},
{
code: "cn",
name: "简体中文",
iso: "zh-CN",
2020-03-12 02:17:59 +00:00
file: "zh-CN.json",
},
{
code: "tw",
name: "繁體中文",
iso: "zh-TW",
file: "zh-TW.json",
},
{
code: "id",
name: "Bahasa Indonesia",
iso: "id-ID",
2020-03-12 02:17:59 +00:00
file: "id-ID.json",
},
{
code: "tr",
name: "Türkçe",
iso: "tr-TR",
2020-03-12 02:17:59 +00:00
file: "tr-TR.json",
2019-12-12 22:35:59 +00:00
},
{
code: "de",
name: "Deutsch",
iso: "de-DE",
2020-03-12 02:17:59 +00:00
file: "de-DE.json",
2019-12-13 06:34:59 +00:00
},
{
code: "ja",
name: "日本語",
iso: "ja-JP",
2020-03-12 02:17:59 +00:00
file: "ja-JP.json",
2020-02-24 18:44:50 +00:00
},
2020-02-25 03:21:33 +00:00
{
code: "ko",
name: "한국어",
iso: "ko-KR",
2020-03-12 02:17:59 +00:00
file: "ko-KR.json",
2020-03-04 06:50:47 +00:00
},
2019-11-27 08:45:11 +00:00
],
defaultLocale: "en",
vueI18n: {
fallbackLocale: "en",
},
2019-11-27 08:45:11 +00:00
lazy: true,
langDir: "lang/",
detectBrowserLanguage: {
alwaysRedirect: true,
fallbackLocale: "en",
},
2019-11-27 08:45:11 +00:00
},
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Build configuration
*/
2019-08-24 03:06:57 +00:00
build: {
/*
2019-09-04 06:49:17 +00:00
** You can extend webpack config here
*/
2020-05-10 07:06:40 +00:00
extend(config, ctx) {
2020-08-13 11:20:02 +00:00
// Sets webpack's mode to development if `isDev` is true.
if (ctx.isDev) {
config.mode = "development"
}
2020-05-10 07:06:40 +00:00
config.node = {
fs: "empty",
}
},
2020-08-13 11:20:02 +00:00
parallel: true,
cache: true,
// hardSource: true,
},
/*
2019-09-04 06:49:17 +00:00
** Generate configuration
*/
generate: {
2020-02-24 18:44:50 +00:00
fallback: true,
},
publicRuntimeConfig: {
GA_ID: process.env.GA_ID || "UA-61422507-4",
GTM_ID: process.env.GTM_ID || "GTM-NMKVBMV",
2020-08-30 05:40:19 +00:00
BASE_URL: process.env.BASE_URL || "https://hoppscotch.io/",
},
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,
},
2020-02-24 18:44:50 +00:00
}