api-client/nuxt.config.js

321 lines
9 KiB
JavaScript
Raw Normal View History

2021-08-10 08:16:42 +00:00
import languages from "./languages"
2021-05-16 06:53:29 +00:00
require("dotenv").config()
2020-10-21 06:50:32 +00:00
// Common options
2020-03-24 02:19:09 +00:00
export const options = {
2020-08-13 11:20:02 +00:00
name: "Hoppscotch",
2021-03-14 15:15:57 +00:00
shortDescription: "Open source API development ecosystem",
2021-05-17 05:55:50 +00:00
description:
"Helps you create requests faster, saving precious time on development.",
2021-08-10 08:16:42 +00:00
keywords:
"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",
2020-03-24 07:06:37 +00:00
loading: {
2021-06-12 16:46:17 +00:00
color: "var(--accent-color)",
background: "var(--primary-color)",
2020-08-13 11:20:02 +00:00
},
app: {
background: "#202124",
},
social: {
2021-04-23 11:38:17 +00:00
twitter: "@hoppscotch_io",
2020-03-24 07:06:37 +00:00
},
2020-02-24 18:44:50 +00:00
}
2020-10-21 06:50:32 +00:00
2019-08-24 03:06:57 +00:00
export default {
2020-10-21 06:50:32 +00:00
// Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
2020-09-22 17:06:37 +00:00
ssr: false,
2020-10-21 06:50:32 +00:00
// Target (https://go.nuxtjs.dev/config-target)
target: "static",
// Default: localhost
server: {
2020-10-21 06:50:32 +00:00
host: "0.0.0.0",
},
2020-10-21 06:50:32 +00:00
// Global page headers (https://go.nuxtjs.dev/config-head)
2019-08-24 03:06:57 +00:00
head: {
2019-11-28 15:11:52 +00:00
meta: [
2019-09-04 06:49:17 +00:00
{
name: "keywords",
2021-08-10 08:16:42 +00:00
content: options.keywords,
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",
content: `${process.env.BASE_URL}/banner.jpg`,
2019-09-04 06:49:17 +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
],
},
2020-10-21 06:50:32 +00:00
// Customize the progress-bar color (https://nuxtjs.org/api/configuration-loading/#customizing-the-progress-bar)
2019-09-04 06:49:17 +00:00
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
},
2020-10-21 06:50:32 +00:00
// Customize the loading indicator (https://nuxtjs.org/api/configuration-loading-indicator)
2019-10-11 08:53:07 +00:00
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
},
2020-10-21 06:50:32 +00:00
// Global CSS (https://go.nuxtjs.dev/config-css)
css: ["~/assets/scss/styles.scss", "~/assets/scss/themes.scss"],
2020-10-21 06:50:32 +00:00
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
2021-07-02 05:01:29 +00:00
"~/plugins/v-tippy",
"~/plugins/v-focus",
2021-05-03 13:18:24 +00:00
"~/plugins/vue-apollo",
2021-08-09 12:25:30 +00:00
"~/plugins/crisp",
{ src: "~/plugins/web-worker", ssr: false },
],
2020-10-21 06:50:32 +00:00
// Auto import components (https://go.nuxtjs.dev/config-components)
2020-08-13 11:20:02 +00:00
components: true,
2020-10-21 06:50:32 +00:00
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
2020-10-21 06:50:32 +00:00
// https://github.com/nuxt-community/pwa-module
"@nuxtjs/pwa",
2021-05-17 05:55:50 +00:00
// https://github.com/nuxt-community/stylelint-module
"@nuxtjs/stylelint-module",
2020-10-21 06:50:32 +00:00
// https://github.com/nuxt-community/analytics-module
"@nuxtjs/google-analytics",
2020-10-21 06:50:32 +00:00
// https://github.com/nuxt-community/gtm-module
"@nuxtjs/gtm",
// https://github.com/windicss/windicss
"nuxt-windicss",
2020-10-21 06:50:32 +00:00
// https://github.com/nuxt-community/color-mode-module
2020-09-22 17:06:37 +00:00
"@nuxtjs/color-mode",
2021-07-03 13:14:58 +00:00
// https://github.com/nuxt-community/svg-module
"@nuxtjs/svg",
// https: //github.com/nuxt-community/google-fonts-module
"@nuxtjs/google-fonts",
// https://github.com/nuxt/typescript
"@nuxt/typescript-build",
2021-05-16 06:53:29 +00:00
// https://github.com/nuxt-community/dotenv-module
"@nuxtjs/dotenv",
2021-07-18 04:33:52 +00:00
// https://github.com/nuxt-community/composition-api
"@nuxtjs/composition-api/module",
],
2020-10-21 06:50:32 +00:00
// Modules (https://go.nuxtjs.dev/config-modules)
2019-08-24 03:06:57 +00:00
modules: [
2020-10-21 06:50:32 +00:00
// https://github.com/nuxt-community/axios-module
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",
2020-10-21 06:50:32 +00:00
// https://github.com/nuxt-community/i18n-module
2021-08-08 15:17:50 +00:00
"@nuxtjs/i18n",
2020-10-21 06:50:32 +00:00
// https://github.com/nuxt-community/robots-module
2020-05-10 06:40:17 +00:00
"@nuxtjs/robots",
2020-10-21 06:50:32 +00:00
// https://github.com/nuxt-community/sitemap-module
2020-08-13 11:20:02 +00:00
"@nuxtjs/sitemap",
2019-08-24 03:06:57 +00:00
],
2021-05-17 05:55:50 +00:00
2020-10-21 06:50:32 +00:00
// PWA module configuration (https://pwa.nuxtjs.org/setup)
2019-09-29 13:21:43 +00:00
pwa: {
meta: {
2020-11-28 11:53:10 +00:00
name: `${options.name} - ${options.shortDescription}`,
description: options.description,
2020-08-13 11:20:02 +00:00
ogHost: process.env.BASE_URL,
2020-11-28 11:53:10 +00:00
ogImage: `${process.env.BASE_URL}/banner.jpg`,
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,
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: "/?source=pwa",
2020-08-23 11:33:49 +00:00
background_color: options.app.background,
},
2019-09-29 13:21:43 +00:00
},
2020-10-21 06:50:32 +00:00
2021-05-17 05:55:50 +00:00
// ESLint module configuration (https://github.com/nuxt-community/eslint-module)
eslint: {
2021-06-30 09:23:15 +00:00
fix: true,
2021-06-30 17:23:48 +00:00
emitWarning: true,
2021-05-17 11:41:58 +00:00
quiet: true,
2021-05-17 05:55:50 +00:00
},
2020-10-21 06:50:32 +00:00
// Toast module configuration (https://github.com/nuxt-community/modules/tree/master/packages/toast)
2019-09-28 09:33:16 +00:00
toast: {
position: "bottom-center",
duration: 3000,
2020-02-24 18:44:50 +00:00
keepOnHover: true,
2019-09-28 09:33:16 +00:00
},
2020-10-21 06:50:32 +00:00
// Google Analytics module configuration (https://github.com/nuxt-community/analytics-module)
2019-09-28 09:33:16 +00:00
googleAnalytics: {
id: process.env.GA_ID,
2019-09-28 09:33:16 +00:00
},
2020-10-21 06:50:32 +00:00
// Google Tag Manager module configuration (https://github.com/nuxt-community/gtm-module)
2020-03-24 02:19:09 +00:00
gtm: {
id: process.env.GTM_ID,
2020-03-24 02:19:09 +00:00
},
2020-10-21 06:50:32 +00:00
// Sitemap module configuration (https://github.com/nuxt-community/sitemap-module)
sitemap: {
2021-05-16 08:40:39 +00:00
hostname: process.env.BASE_URL || "https://hoppscotch.io",
},
2020-10-21 06:50:32 +00:00
// Robots module configuration (https://github.com/nuxt-community/robots-module)
2019-11-03 06:06:41 +00:00
robots: {
UserAgent: "*",
Disallow: "",
Allow: "/",
Sitemap: `${process.env.BASE_URL}/sitemap.xml`,
2019-11-03 06:06:41 +00:00
},
2020-10-21 06:50:32 +00:00
// Google Fonts module configuration (https://github.com/nuxt-community/google-fonts-module)
googleFonts: {
2021-07-10 13:15:39 +00:00
display: "block",
families: {
Inter: [400, 500, 600, 700, 800],
2021-07-10 13:15:39 +00:00
"Material+Icons": true,
2021-08-01 17:33:54 +00:00
"Roboto+Mono": [400, 500, 600, 700, 800],
},
},
2020-10-21 06:50:32 +00:00
// i18n module configuration (https://github.com/nuxt-community/i18n-module)
2019-11-27 08:45:11 +00:00
i18n: {
2021-08-10 08:16:42 +00:00
locales: languages,
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
},
2020-10-21 06:50:32 +00:00
2021-07-16 15:05:15 +00:00
// Color mode configuration (https://github.com/nuxt-community/color-mode-module)
2021-07-09 17:19:45 +00:00
colorMode: {
classSuffix: "",
},
2020-10-21 06:50:32 +00:00
// Build Configuration (https://go.nuxtjs.dev/config-build)
2019-08-24 03:06:57 +00:00
build: {
2020-10-21 06:50:32 +00:00
// You can extend webpack config here
extend(config, { isDev, isClient }) {
2020-08-13 11:20:02 +00:00
// Sets webpack's mode to development if `isDev` is true.
if (isDev) {
2020-08-13 11:20:02 +00:00
config.mode = "development"
}
2021-06-27 18:54:16 +00:00
2020-05-10 07:06:40 +00:00
config.node = {
fs: "empty",
}
if (isClient) {
config.module.rules.unshift({
test: /\.worker\.(c|m)?js$/i,
use: { loader: "worker-loader" },
exclude: /(node_modules)/,
})
2021-06-27 18:54:16 +00:00
config.module.rules.push({
test: /\.md$/i,
use: { loader: "raw-loader" },
exclude: /(node_modules)/,
})
2021-07-01 16:39:11 +00:00
config.module.rules.push({
test: /\.geojson$/i,
use: { loader: "json-loader" },
exclude: /(node_modules)/,
})
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
})
config.module.rules.push({
test: /\.js$/,
include: /(node_modules)/,
2021-05-17 05:55:50 +00:00
exclude: /(node_modules)\/(ace-builds)|(@firebase)/,
loader: "babel-loader",
options: {
plugins: [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
],
},
})
}
2020-05-10 07:06:40 +00:00
},
2020-08-13 11:20:02 +00:00
parallel: true,
cache: true,
// hardSource: true,
},
2020-10-21 06:50:32 +00:00
// Generate configuration (https://nuxtjs.org/api/configuration-generate)
generate: {
2020-02-24 18:44:50 +00:00
fallback: true,
},
2021-05-16 07:23:40 +00:00
// dotenv configuration (https://github.com/nuxt-community/dotenv-module)
env: {
GA_ID: process.env.GA_ID,
GTM_ID: process.env.GTM_ID,
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,
BASE_URL: process.env.BASE_URL,
},
2021-07-01 16:39:11 +00:00
// Router configuration (https://nuxtjs.org/api/configuration-router)
router: {
2021-08-03 04:54:32 +00:00
linkActiveClass: "active-link",
linkExactActiveClass: "exact-active-link",
2021-07-01 16:39:11 +00:00
},
2020-02-24 18:44:50 +00:00
}