nuxt.config.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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. "~/plugins/vue-rx",
  88. { src: "~/plugins/web-worker", ssr: false },
  89. ],
  90. // Auto import components (https://go.nuxtjs.dev/config-components)
  91. components: true,
  92. // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  93. buildModules: [
  94. // https://github.com/nuxt-community/pwa-module
  95. "@nuxtjs/pwa",
  96. // https://github.com/nuxt-community/analytics-module
  97. "@nuxtjs/google-analytics",
  98. // https://github.com/nuxt-community/gtm-module
  99. "@nuxtjs/gtm",
  100. // https://github.com/nuxt-community/nuxt-tailwindcss
  101. "@nuxtjs/tailwindcss",
  102. // https://github.com/nuxt-community/color-mode-module
  103. "@nuxtjs/color-mode",
  104. // https: //github.com/nuxt-community/google-fonts-module
  105. "@nuxtjs/google-fonts",
  106. // https://github.com/nuxt/typescript
  107. "@nuxt/typescript-build",
  108. ],
  109. // Modules (https://go.nuxtjs.dev/config-modules)
  110. modules: [
  111. // https://github.com/nuxt-community/axios-module
  112. "@nuxtjs/axios",
  113. // https://github.com/nuxt-community/modules/tree/master/packages/toast
  114. "@nuxtjs/toast",
  115. // https://github.com/nuxt-community/i18n-module
  116. "nuxt-i18n",
  117. // https://github.com/nuxt-community/robots-module
  118. "@nuxtjs/robots",
  119. // https://github.com/nuxt-community/sitemap-module
  120. "@nuxtjs/sitemap",
  121. ],
  122. // PWA module configuration (https://pwa.nuxtjs.org/setup)
  123. pwa: {
  124. meta: {
  125. name: `${options.name} - ${options.shortDescription}`,
  126. description: options.description,
  127. ogHost: process.env.BASE_URL,
  128. ogImage: `${process.env.BASE_URL}/banner.jpg`,
  129. twitterCard: "summary_large_image",
  130. twitterSite: options.social.twitter,
  131. twitterCreator: options.social.twitter,
  132. theme_color: options.app.background,
  133. },
  134. manifest: {
  135. name: options.name,
  136. short_name: options.name,
  137. description: options.shortDescription,
  138. start_url: "/?source=pwa",
  139. background_color: options.app.background,
  140. },
  141. },
  142. // Toast module configuration (https://github.com/nuxt-community/modules/tree/master/packages/toast)
  143. toast: {
  144. position: "bottom-center",
  145. duration: 3000,
  146. theme: "bubble",
  147. keepOnHover: true,
  148. },
  149. // Google Analytics module configuration (https://github.com/nuxt-community/analytics-module)
  150. googleAnalytics: {
  151. id: process.env.GA_ID,
  152. },
  153. // Google Tag Manager module configuration (https://github.com/nuxt-community/gtm-module)
  154. gtm: {
  155. id: process.env.GTM_ID,
  156. },
  157. // Sitemap module configuration (https://github.com/nuxt-community/sitemap-module)
  158. sitemap: {
  159. hostname: process.env.BASE_URL || "https://hoppscotch.io",
  160. },
  161. // Robots module configuration (https://github.com/nuxt-community/robots-module)
  162. robots: {
  163. UserAgent: "*",
  164. Disallow: "",
  165. Allow: "/",
  166. Sitemap: `${process.env.BASE_URL}/sitemap.xml`,
  167. },
  168. // Color Mode module configuration (https://github.com/nuxt-community/color-mode-module)
  169. colorMode: {
  170. classSuffix: "",
  171. preference: "dark",
  172. fallback: "dark",
  173. },
  174. // Google Fonts module configuration (https://github.com/nuxt-community/google-fonts-module)
  175. googleFonts: {
  176. download: true,
  177. display: "swap",
  178. families: {
  179. "Material+Icons": true,
  180. Poppins: [400, 500, 600, 700, 800],
  181. "Roboto+Mono": true,
  182. },
  183. },
  184. // TailwindCSS module configuration (https://github.com/nuxt-community/tailwindcss-module)
  185. tailwindcss: {
  186. jit: true,
  187. viewer: false,
  188. },
  189. // i18n module configuration (https://github.com/nuxt-community/i18n-module)
  190. i18n: {
  191. locales: [
  192. {
  193. code: "en",
  194. name: "English",
  195. iso: "en-US",
  196. file: "en-US.json",
  197. },
  198. {
  199. code: "es",
  200. name: "Español",
  201. iso: "es-ES",
  202. file: "es-ES.json",
  203. },
  204. {
  205. code: "fr",
  206. name: "Français",
  207. iso: "fr-FR",
  208. file: "fr-FR.json",
  209. },
  210. {
  211. code: "fa",
  212. name: "Farsi",
  213. iso: "fa-IR",
  214. file: "fa-IR.json",
  215. },
  216. {
  217. code: "pt",
  218. name: "Português",
  219. iso: "pt-PT",
  220. file: "pt-PT.json",
  221. },
  222. {
  223. code: "pt-br",
  224. name: "Português Brasileiro",
  225. iso: "pt-BR",
  226. file: "pt-BR.json",
  227. },
  228. {
  229. code: "cn",
  230. name: "简体中文",
  231. iso: "zh-CN",
  232. file: "zh-CN.json",
  233. },
  234. {
  235. code: "tw",
  236. name: "繁體中文",
  237. iso: "zh-TW",
  238. file: "zh-TW.json",
  239. },
  240. {
  241. code: "id",
  242. name: "Bahasa Indonesia",
  243. iso: "id-ID",
  244. file: "id-ID.json",
  245. },
  246. {
  247. code: "tr",
  248. name: "Türkçe",
  249. iso: "tr-TR",
  250. file: "tr-TR.json",
  251. },
  252. {
  253. code: "de",
  254. name: "Deutsch",
  255. iso: "de-DE",
  256. file: "de-DE.json",
  257. },
  258. {
  259. code: "ja",
  260. name: "日本語",
  261. iso: "ja-JP",
  262. file: "ja-JP.json",
  263. },
  264. {
  265. code: "ko",
  266. name: "한국어",
  267. iso: "ko-KR",
  268. file: "ko-KR.json",
  269. },
  270. {
  271. code: "bn",
  272. name: "Bengali",
  273. iso: "bn-BD",
  274. file: "bn-BD.json",
  275. },
  276. {
  277. code: "ml",
  278. name: "മലയാളം",
  279. iso: "ml-ML",
  280. file: "ml-ML.json",
  281. },
  282. {
  283. code: "vi",
  284. name: "Vietnamese",
  285. iso: "vi-VN",
  286. file: "vi-VN.json",
  287. },
  288. {
  289. code: "nl",
  290. name: "Dutch",
  291. iso: "nl-BE",
  292. file: "nl-BE.json",
  293. },
  294. ],
  295. defaultLocale: "en",
  296. vueI18n: {
  297. fallbackLocale: "en",
  298. },
  299. lazy: true,
  300. langDir: "lang/",
  301. detectBrowserLanguage: {
  302. alwaysRedirect: true,
  303. fallbackLocale: "en",
  304. },
  305. },
  306. // Build Configuration (https://go.nuxtjs.dev/config-build)
  307. build: {
  308. // You can extend webpack config here
  309. extend(config, { isDev, isClient }) {
  310. // Sets webpack's mode to development if `isDev` is true.
  311. if (isDev) {
  312. config.mode = "development"
  313. }
  314. config.node = {
  315. fs: "empty",
  316. }
  317. if (isClient) {
  318. config.module.rules.unshift({
  319. test: /\.worker\.(c|m)?js$/i,
  320. use: { loader: "worker-loader" },
  321. exclude: /(node_modules)/,
  322. })
  323. config.module.rules.push({
  324. test: /\.md$/i,
  325. use: { loader: "raw-loader" },
  326. exclude: /(node_modules)/,
  327. })
  328. config.module.rules.push({
  329. test: /\.mjs$/,
  330. include: /node_modules/,
  331. type: "javascript/auto",
  332. })
  333. config.module.rules.push({
  334. test: /\.js$/,
  335. include: /(node_modules)/,
  336. exclude: /(node_modules)\/(ace\-builds)|(@firebase)/,
  337. loader: "babel-loader",
  338. options: {
  339. plugins: [
  340. "@babel/plugin-proposal-class-properties",
  341. "@babel/plugin-proposal-nullish-coalescing-operator",
  342. "@babel/plugin-proposal-optional-chaining",
  343. ],
  344. },
  345. })
  346. }
  347. },
  348. parallel: true,
  349. cache: true,
  350. // hardSource: true,
  351. },
  352. // Generate configuration (https://nuxtjs.org/api/configuration-generate)
  353. generate: {
  354. fallback: true,
  355. },
  356. // Public runtime configuration (https://nuxtjs.org/guide/runtime-config)
  357. publicRuntimeConfig: {
  358. GA_ID: process.env.GA_ID || "UA-61422507-4",
  359. GTM_ID: process.env.GTM_ID || "GTM-NMKVBMV",
  360. BASE_URL: process.env.BASE_URL || "https://hoppscotch.io",
  361. },
  362. // Private runtime configuration (https://nuxtjs.org/guide/runtime-config)
  363. privateRuntimeConfig: {
  364. API_KEY: process.env.API_KEY,
  365. AUTH_DOMAIN: process.env.AUTH_DOMAIN,
  366. DATABASE_URL: process.env.DATABASE_URL,
  367. PROJECT_ID: process.env.PROJECT_ID,
  368. STORAGE_BUCKET: process.env.STORAGE_BUCKET,
  369. MESSAGING_SENDER_ID: process.env.MESSAGING_SENDER_ID,
  370. APP_ID: process.env.APP_ID,
  371. MEASUREMENT_ID: process.env.MEASUREMENT_ID,
  372. },
  373. }