nuxt.config.js 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. // Common options
  2. export const options = {
  3. name: "Hoppscotch",
  4. shortDescription: "Open source API development ecosystem",
  5. description: "Helps you create requests faster, saving precious time on development.",
  6. loading: {
  7. color: "var(--ac-color)",
  8. background: "var(--bg-color)",
  9. },
  10. app: {
  11. background: "#202124",
  12. },
  13. social: {
  14. twitter: "@liyasthomas",
  15. },
  16. }
  17. export default {
  18. // Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
  19. ssr: false,
  20. // Target (https://go.nuxtjs.dev/config-target)
  21. target: "static",
  22. // Default: localhost
  23. server: {
  24. host: "0.0.0.0",
  25. },
  26. // Global page headers (https://go.nuxtjs.dev/config-head)
  27. head: {
  28. meta: [
  29. {
  30. name: "keywords",
  31. content:
  32. "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",
  33. },
  34. {
  35. name: "X-UA-Compatible",
  36. content: "IE=edge, chrome=1",
  37. },
  38. {
  39. itemprop: "name",
  40. content: `${options.name} • ${options.shortDescription}`,
  41. },
  42. {
  43. itemprop: "description",
  44. content: options.description,
  45. },
  46. {
  47. itemprop: "image",
  48. content: `${process.env.BASE_URL}/banner.jpg`,
  49. },
  50. // Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
  51. {
  52. name: "application-name",
  53. content: options.name,
  54. },
  55. // Windows phone tile icon
  56. {
  57. name: "msapplication-TileImage",
  58. content: `/icon.png`,
  59. },
  60. {
  61. name: "msapplication-TileColor",
  62. content: options.app.background,
  63. },
  64. {
  65. name: "msapplication-tap-highlight",
  66. content: "no",
  67. },
  68. ],
  69. },
  70. // Customize the progress-bar color (https://nuxtjs.org/api/configuration-loading/#customizing-the-progress-bar)
  71. loading: {
  72. color: options.loading.color,
  73. continuous: true,
  74. },
  75. // Customize the loading indicator (https://nuxtjs.org/api/configuration-loading-indicator)
  76. loadingIndicator: {
  77. name: "pulse",
  78. color: options.loading.color,
  79. background: options.loading.background,
  80. },
  81. // Global CSS (https://go.nuxtjs.dev/config-css)
  82. css: ["~/assets/scss/styles.scss", "~/assets/scss/themes.scss"],
  83. // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  84. plugins: [
  85. "~/plugins/vuex-persist",
  86. "~/plugins/v-tooltip",
  87. { src: "~/plugins/web-worker", ssr: false },
  88. ],
  89. // Auto import components (https://go.nuxtjs.dev/config-components)
  90. components: true,
  91. // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  92. buildModules: [
  93. // https://github.com/nuxt-community/pwa-module
  94. "@nuxtjs/pwa",
  95. // https://github.com/nuxt-community/analytics-module
  96. "@nuxtjs/google-analytics",
  97. // https://github.com/nuxt-community/gtm-module
  98. "@nuxtjs/gtm",
  99. // https://github.com/nuxt-community/nuxt-tailwindcss
  100. "@nuxtjs/tailwindcss",
  101. // https://github.com/nuxt-community/color-mode-module
  102. "@nuxtjs/color-mode",
  103. // https: //github.com/nuxt-community/google-fonts-module
  104. "@nuxtjs/google-fonts",
  105. ],
  106. // Modules (https://go.nuxtjs.dev/config-modules)
  107. modules: [
  108. // https://github.com/nuxt-community/axios-module
  109. "@nuxtjs/axios",
  110. // https://github.com/nuxt-community/modules/tree/master/packages/toast
  111. "@nuxtjs/toast",
  112. // https://github.com/nuxt-community/i18n-module
  113. "nuxt-i18n",
  114. // https://github.com/nuxt-community/robots-module
  115. "@nuxtjs/robots",
  116. // https://github.com/nuxt-community/sitemap-module
  117. "@nuxtjs/sitemap",
  118. ],
  119. // PWA module configuration (https://pwa.nuxtjs.org/setup)
  120. pwa: {
  121. meta: {
  122. name: `${options.name} - ${options.shortDescription}`,
  123. description: options.description,
  124. ogHost: process.env.BASE_URL,
  125. ogImage: `${process.env.BASE_URL}/banner.jpg`,
  126. twitterCard: "summary_large_image",
  127. twitterSite: options.social.twitter,
  128. twitterCreator: options.social.twitter,
  129. theme_color: options.app.background,
  130. },
  131. manifest: {
  132. name: options.name,
  133. short_name: options.name,
  134. description: options.shortDescription,
  135. start_url: "/?source=pwa",
  136. background_color: options.app.background,
  137. },
  138. },
  139. // Toast module configuration (https://github.com/nuxt-community/modules/tree/master/packages/toast)
  140. toast: {
  141. position: "bottom-center",
  142. duration: 3000,
  143. theme: "bubble",
  144. keepOnHover: true,
  145. },
  146. // Google Analytics module configuration (https://github.com/nuxt-community/analytics-module)
  147. googleAnalytics: {
  148. id: process.env.GA_ID,
  149. },
  150. // Google Tag Manager module configuration (https://github.com/nuxt-community/gtm-module)
  151. gtm: {
  152. id: process.env.GTM_ID,
  153. },
  154. // Sitemap module configuration (https://github.com/nuxt-community/sitemap-module)
  155. sitemap: {
  156. hostname: process.env.BASE_URL || "https://hoppscotch.io",
  157. },
  158. // Robots module configuration (https://github.com/nuxt-community/robots-module)
  159. robots: {
  160. UserAgent: "*",
  161. Disallow: "",
  162. Allow: "/",
  163. Sitemap: `${process.env.BASE_URL}/sitemap.xml`,
  164. },
  165. // Color Mode module configuration (https://github.com/nuxt-community/color-mode-module)
  166. colorMode: {
  167. classSuffix: "",
  168. preference: "dark",
  169. fallback: "dark",
  170. },
  171. // Google Fonts module configuration (https://github.com/nuxt-community/google-fonts-module)
  172. googleFonts: {
  173. display: "swap",
  174. families: {
  175. "Material+Icons": true,
  176. Poppins: [400, 500, 600, 700, 800],
  177. "Roboto+Mono": true,
  178. },
  179. },
  180. // i18n module configuration (https://github.com/nuxt-community/i18n-module)
  181. i18n: {
  182. locales: [
  183. {
  184. code: "en",
  185. name: "English",
  186. iso: "en-US",
  187. file: "en-US.json",
  188. },
  189. {
  190. code: "es",
  191. name: "Español",
  192. iso: "es-ES",
  193. file: "es-ES.json",
  194. },
  195. {
  196. code: "fr",
  197. name: "Français",
  198. iso: "fr-FR",
  199. file: "fr-FR.json",
  200. },
  201. {
  202. code: "fa",
  203. name: "Farsi",
  204. iso: "fa-IR",
  205. file: "fa-IR.json",
  206. },
  207. {
  208. code: "pt",
  209. name: "Português",
  210. iso: "pt-PT",
  211. file: "pt-PT.json",
  212. },
  213. {
  214. code: "pt-br",
  215. name: "Português Brasileiro",
  216. iso: "pt-BR",
  217. file: "pt-BR.json",
  218. },
  219. {
  220. code: "cn",
  221. name: "简体中文",
  222. iso: "zh-CN",
  223. file: "zh-CN.json",
  224. },
  225. {
  226. code: "tw",
  227. name: "繁體中文",
  228. iso: "zh-TW",
  229. file: "zh-TW.json",
  230. },
  231. {
  232. code: "id",
  233. name: "Bahasa Indonesia",
  234. iso: "id-ID",
  235. file: "id-ID.json",
  236. },
  237. {
  238. code: "tr",
  239. name: "Türkçe",
  240. iso: "tr-TR",
  241. file: "tr-TR.json",
  242. },
  243. {
  244. code: "de",
  245. name: "Deutsch",
  246. iso: "de-DE",
  247. file: "de-DE.json",
  248. },
  249. {
  250. code: "ja",
  251. name: "日本語",
  252. iso: "ja-JP",
  253. file: "ja-JP.json",
  254. },
  255. {
  256. code: "ko",
  257. name: "한국어",
  258. iso: "ko-KR",
  259. file: "ko-KR.json",
  260. },
  261. {
  262. code: "bn",
  263. name: "Bengali",
  264. iso: "bn-BD",
  265. file: "bn-BD.json",
  266. },
  267. {
  268. code: "ml",
  269. name: "മലയാളം",
  270. iso: "ml-ML",
  271. file: "ml-ML.json",
  272. },
  273. {
  274. code: "vi",
  275. name: "Vietnamese",
  276. iso: "vi-VN",
  277. file: "vi-VN.json",
  278. },
  279. {
  280. code: "nl",
  281. name: "Dutch",
  282. iso: "nl-BE",
  283. file: "nl-BE.json",
  284. },
  285. ],
  286. defaultLocale: "en",
  287. vueI18n: {
  288. fallbackLocale: "en",
  289. },
  290. lazy: true,
  291. langDir: "lang/",
  292. detectBrowserLanguage: {
  293. alwaysRedirect: true,
  294. fallbackLocale: "en",
  295. },
  296. },
  297. // Build Configuration (https://go.nuxtjs.dev/config-build)
  298. build: {
  299. // You can extend webpack config here
  300. extend(config, { isDev, isClient }) {
  301. // Sets webpack's mode to development if `isDev` is true.
  302. if (isDev) {
  303. config.mode = "development"
  304. }
  305. config.node = {
  306. fs: "empty",
  307. }
  308. if (isClient) {
  309. config.module.rules.unshift({
  310. test: /\.worker\.(c|m)?js$/i,
  311. use: { loader: "worker-loader" },
  312. exclude: /(node_modules)/,
  313. })
  314. config.module.rules.push({
  315. test: /\.md$/i,
  316. use: { loader: "raw-loader" },
  317. exclude: /(node_modules)/,
  318. })
  319. config.module.rules.push({
  320. test: /\.mjs$/,
  321. include: /node_modules/,
  322. type: "javascript/auto",
  323. })
  324. }
  325. },
  326. parallel: true,
  327. cache: true,
  328. // hardSource: true,
  329. },
  330. // Generate configuration (https://nuxtjs.org/api/configuration-generate)
  331. generate: {
  332. fallback: true,
  333. },
  334. // Public runtime configuration (https://nuxtjs.org/guide/runtime-config)
  335. publicRuntimeConfig: {
  336. GA_ID: process.env.GA_ID || "UA-61422507-4",
  337. GTM_ID: process.env.GTM_ID || "GTM-NMKVBMV",
  338. BASE_URL: process.env.BASE_URL || "https://hoppscotch.io",
  339. },
  340. // Private runtime configuration (https://nuxtjs.org/guide/runtime-config)
  341. privateRuntimeConfig: {
  342. API_KEY: process.env.API_KEY,
  343. AUTH_DOMAIN: process.env.AUTH_DOMAIN,
  344. DATABASE_URL: process.env.DATABASE_URL,
  345. PROJECT_ID: process.env.PROJECT_ID,
  346. STORAGE_BUCKET: process.env.STORAGE_BUCKET,
  347. MESSAGING_SENDER_ID: process.env.MESSAGING_SENDER_ID,
  348. APP_ID: process.env.APP_ID,
  349. MEASUREMENT_ID: process.env.MEASUREMENT_ID,
  350. },
  351. }