nuxt.config.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. // Some helpful application constants.
  2. // TODO: Use these when rendering the pages (rather than just for head/meta tags...)
  3. export const options = {
  4. name: "Hoppscotch",
  5. shortDescription: "A free, fast and beautiful API request builder",
  6. description: "Helps you create requests faster, saving precious time on development.",
  7. loading: {
  8. color: "var(--ac-color)",
  9. background: "var(--bg-color)",
  10. },
  11. app: {
  12. background: "#202124",
  13. },
  14. social: {
  15. twitter: "@liyasthomas",
  16. },
  17. }
  18. export default {
  19. ssr: false,
  20. server: {
  21. host: "0.0.0.0", // default: localhost
  22. },
  23. /*
  24. ** Headers of the page
  25. */
  26. head: {
  27. title: `${options.name} • ${options.shortDescription}`,
  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. {
  51. property: "og:image",
  52. content: `${process.env.BASE_URL}banner.jpg`,
  53. },
  54. // Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
  55. {
  56. name: "application-name",
  57. content: options.name,
  58. },
  59. // Windows phone tile icon
  60. {
  61. name: "msapplication-TileImage",
  62. content: `/icon.png`,
  63. },
  64. {
  65. name: "msapplication-TileColor",
  66. content: options.app.background,
  67. },
  68. {
  69. name: "msapplication-tap-highlight",
  70. content: "no",
  71. },
  72. ],
  73. link: [
  74. {
  75. rel: "apple-touch-icon",
  76. href: "/icon.png",
  77. },
  78. {
  79. rel: "apple-touch-startup-image",
  80. href: "/icon.png",
  81. },
  82. ],
  83. },
  84. /*
  85. ** Customize the progress-bar color
  86. */
  87. loading: {
  88. color: options.loading.color,
  89. continuous: true,
  90. },
  91. /*
  92. ** Customize the loading indicator
  93. */
  94. loadingIndicator: {
  95. name: "pulse",
  96. color: options.loading.color,
  97. background: options.loading.background,
  98. },
  99. /*
  100. ** Global CSS
  101. */
  102. css: ["~/assets/scss/styles.scss", "~/assets/scss/themes.scss", "~/assets/scss/fonts.scss"],
  103. /*
  104. ** Plugins to load before mounting the App
  105. */
  106. plugins: ["~/plugins/vuex-persist", "~/plugins/v-tooltip"],
  107. /*
  108. ** Auto import components
  109. ** See https://nuxtjs.org/api/configuration-components
  110. */
  111. components: true,
  112. /*
  113. ** Nuxt.js dev-modules
  114. */
  115. buildModules: [
  116. // https://pwa.nuxtjs.org
  117. "@nuxtjs/pwa",
  118. // Doc: https://github.com/nuxt-community/analytics-module
  119. "@nuxtjs/google-analytics",
  120. // Doc: https://github.com/nuxt-community/gtm-module
  121. "@nuxtjs/gtm",
  122. // Doc: https://github.com/nuxt-community/svg-module
  123. "@nuxtjs/svg",
  124. // Doc: https://tailwindcss.nuxtjs.org
  125. "@nuxtjs/tailwindcss",
  126. // Doc: https://color-mode.nuxtjs.org
  127. "@nuxtjs/color-mode",
  128. ],
  129. /*
  130. ** Nuxt.js modules
  131. */
  132. modules: [
  133. // https://axios.nuxtjs.org
  134. "@nuxtjs/axios",
  135. // https://github.com/nuxt-community/modules/tree/master/packages/toast
  136. "@nuxtjs/toast",
  137. // Doc: https://github.com/nuxt-community/nuxt-i18n
  138. "nuxt-i18n",
  139. // Doc: https://github.com/nuxt-community/robots-module
  140. "@nuxtjs/robots",
  141. // Doc: https://github.com/nuxt-community/sitemap-module
  142. "@nuxtjs/sitemap",
  143. ],
  144. pwa: {
  145. meta: {
  146. ogHost: process.env.BASE_URL,
  147. twitterCard: "summary_large_image",
  148. twitterSite: options.social.twitter,
  149. twitterCreator: options.social.twitter,
  150. description: options.shortDescription,
  151. theme_color: options.app.background,
  152. },
  153. manifest: {
  154. name: options.name,
  155. short_name: options.name,
  156. description: options.shortDescription,
  157. start_url: "/",
  158. background_color: options.app.background,
  159. theme_color: options.app.background,
  160. },
  161. },
  162. toast: {
  163. position: "bottom-center",
  164. duration: 3000,
  165. theme: "bubble",
  166. keepOnHover: true,
  167. },
  168. googleAnalytics: {
  169. id: process.env.GA_ID,
  170. },
  171. gtm: {
  172. id: process.env.GTM_ID,
  173. },
  174. sitemap: {
  175. hostname: process.env.BASE_URL || "https://hoppscotch.io/",
  176. },
  177. robots: {
  178. UserAgent: "*",
  179. Disallow: "",
  180. Allow: "/",
  181. Sitemap: `${process.env.BASE_URL}sitemap.xml`,
  182. },
  183. colorMode: {
  184. classSuffix: "",
  185. preference: "dark",
  186. fallback: "dark",
  187. },
  188. i18n: {
  189. locales: [
  190. {
  191. code: "en",
  192. name: "English",
  193. iso: "en-US",
  194. file: "en-US.json",
  195. },
  196. {
  197. code: "es",
  198. name: "Español",
  199. iso: "es-ES",
  200. file: "es-ES.json",
  201. },
  202. {
  203. code: "fr",
  204. name: "Français",
  205. iso: "fr-FR",
  206. file: "fr-FR.json",
  207. },
  208. {
  209. code: "fa",
  210. name: "Farsi",
  211. iso: "fa-IR",
  212. file: "fa-IR.json",
  213. },
  214. {
  215. code: "pt",
  216. name: "Português",
  217. iso: "pt-PT",
  218. file: "pt-PT.json",
  219. },
  220. {
  221. code: "pt-br",
  222. name: "Português Brasileiro",
  223. iso: "pt-BR",
  224. file: "pt-BR.json",
  225. },
  226. {
  227. code: "cn",
  228. name: "简体中文",
  229. iso: "zh-CN",
  230. file: "zh-CN.json",
  231. },
  232. {
  233. code: "tw",
  234. name: "繁體中文",
  235. iso: "zh-TW",
  236. file: "zh-TW.json",
  237. },
  238. {
  239. code: "id",
  240. name: "Bahasa Indonesia",
  241. iso: "id-ID",
  242. file: "id-ID.json",
  243. },
  244. {
  245. code: "tr",
  246. name: "Türkçe",
  247. iso: "tr-TR",
  248. file: "tr-TR.json",
  249. },
  250. {
  251. code: "de",
  252. name: "Deutsch",
  253. iso: "de-DE",
  254. file: "de-DE.json",
  255. },
  256. {
  257. code: "ja",
  258. name: "日本語",
  259. iso: "ja-JP",
  260. file: "ja-JP.json",
  261. },
  262. {
  263. code: "ko",
  264. name: "한국어",
  265. iso: "ko-KR",
  266. file: "ko-KR.json",
  267. },
  268. ],
  269. defaultLocale: "en",
  270. vueI18n: {
  271. fallbackLocale: "en",
  272. },
  273. lazy: true,
  274. langDir: "lang/",
  275. detectBrowserLanguage: {
  276. alwaysRedirect: true,
  277. fallbackLocale: "en",
  278. },
  279. },
  280. /*
  281. ** Build configuration
  282. */
  283. build: {
  284. /*
  285. ** You can extend webpack config here
  286. */
  287. extend(config, ctx) {
  288. // Sets webpack's mode to development if `isDev` is true.
  289. if (ctx.isDev) {
  290. config.mode = "development"
  291. }
  292. config.node = {
  293. fs: "empty",
  294. }
  295. },
  296. parallel: true,
  297. cache: true,
  298. // hardSource: true,
  299. },
  300. /*
  301. ** Generate configuration
  302. */
  303. generate: {
  304. fallback: true,
  305. },
  306. publicRuntimeConfig: {
  307. GA_ID: process.env.GA_ID || "UA-61422507-4",
  308. GTM_ID: process.env.GTM_ID || "GTM-NMKVBMV",
  309. BASE_URL: process.env.BASE_URL || "https://hoppscotch.io/",
  310. },
  311. privateRuntimeConfig: {
  312. API_KEY: process.env.API_KEY,
  313. AUTH_DOMAIN: process.env.AUTH_DOMAIN,
  314. DATABASE_URL: process.env.DATABASE_URL,
  315. PROJECT_ID: process.env.PROJECT_ID,
  316. STORAGE_BUCKET: process.env.STORAGE_BUCKET,
  317. MESSAGING_SENDER_ID: process.env.MESSAGING_SENDER_ID,
  318. APP_ID: process.env.APP_ID,
  319. MEASUREMENT_ID: process.env.MEASUREMENT_ID,
  320. },
  321. }