nuxt.config.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. // Some helpful application constants.
  2. // TODO: Use these when rendering the pages (rather than just for head/meta tags...)
  3. export const meta = {
  4. name: "Postwoman",
  5. shortDescription: "API request builder",
  6. description: "The Postwoman API request builder helps you create your requests faster, saving you precious time on your development."
  7. };
  8. // Sets the base path for the router.
  9. // Important for deploying to GitHub pages.
  10. // -- Travis includes the author in the repo slug,
  11. // so if there's a /, we need to get everything after it.
  12. let repoName = (process.env.TRAVIS_REPO_SLUG || '').split('/').pop();
  13. export const routerBase = process.env.DEPLOY_ENV === 'GH_PAGES' ? {
  14. router: {
  15. base: `/${repoName}/`
  16. }
  17. } : {
  18. router: {
  19. base: '/'
  20. }
  21. };
  22. export default {
  23. mode: 'spa',
  24. /*
  25. ** Headers of the page
  26. */
  27. server: {
  28. host: '0.0.0.0', // default: localhost
  29. },
  30. head: {
  31. title: `${meta.name} \u2022 ${meta.shortDescription}`,
  32. meta: [
  33. {
  34. charset: 'utf-8'
  35. },
  36. {
  37. name: 'viewport',
  38. content: 'width=device-width, initial-scale=1, minimum-scale=1, shrink-to-fit=no, minimal-ui'
  39. },
  40. {
  41. hid: 'description',
  42. name: 'description',
  43. content: meta.description || ''
  44. },
  45. {
  46. name: 'keywords',
  47. content: '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'
  48. },
  49. {
  50. name: 'X-UA-Compatible',
  51. content: "IE=edge, chrome=1"
  52. },
  53. {
  54. itemprop: "name",
  55. content: `${meta.name} \u2022 ${meta.shortDescription}`
  56. },
  57. {
  58. itemprop: "description",
  59. content: meta.description
  60. },
  61. {
  62. itemprop: "image",
  63. content: `${routerBase.router.base}icons/icon-192x192.png`
  64. },
  65. // Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
  66. {
  67. name: 'application-name',
  68. content: meta.name
  69. },
  70. // Add to homescreen for Safari on iOS
  71. {
  72. name: 'apple-mobile-web-app-capable',
  73. content: 'yes'
  74. },
  75. {
  76. name: 'apple-mobile-web-app-status-bar-style',
  77. content: 'black-translucent'
  78. },
  79. {
  80. name: 'apple-mobile-web-app-title',
  81. content: meta.name
  82. },
  83. // Windows phone tile icon
  84. {
  85. name: 'msapplication-TileImage',
  86. content: `${routerBase.router.base}icons/icon-144x144.png`
  87. },
  88. {
  89. name: 'msapplication-TileColor',
  90. content: '#252628'
  91. },
  92. {
  93. name: 'msapplication-tap-highlight',
  94. content: 'no'
  95. },
  96. // OpenGraph
  97. {
  98. property: 'og:site_name',
  99. content: meta.name
  100. },
  101. {
  102. property: 'og:url',
  103. content: 'https://postwoman.io'
  104. },
  105. {
  106. property: 'og:type',
  107. content: 'website'
  108. },
  109. {
  110. property: 'og:title',
  111. content: `${meta.name} \u2022 ${meta.shortDescription}`
  112. },
  113. {
  114. property: 'og:description',
  115. content: meta.description
  116. },
  117. {
  118. property: 'og:image',
  119. content: `${routerBase.router.base}icons/icon-144x144.png`
  120. },
  121. // Twitter
  122. {
  123. name: 'twitter:card',
  124. content: "summary"
  125. },
  126. {
  127. name: 'twitter:site',
  128. content: "@liyasthomas"
  129. },
  130. {
  131. name: 'twitter:creator',
  132. content: "@liyasthomas"
  133. },
  134. {
  135. name: 'twitter:url',
  136. content: "https://postwoman.io"
  137. },
  138. {
  139. name: 'twitter:title',
  140. content: meta.name
  141. },
  142. {
  143. name: 'twitter:description',
  144. content: meta.shortDescription
  145. },
  146. {
  147. name: 'twitter:image',
  148. content: `${routerBase.router.base}icons/icon-144x144.png`
  149. },
  150. ],
  151. link: [
  152. {
  153. rel: 'icon',
  154. type: 'image/x-icon',
  155. href: `${routerBase.router.base}favicon.ico`
  156. },
  157. // Home-screen icons (iOS)
  158. {
  159. rel: 'apple-touch-icon',
  160. href: `${routerBase.router.base}icons/icon-48x48.png`
  161. },
  162. {
  163. rel: 'apple-touch-icon',
  164. sizes: '72x72',
  165. href: `${routerBase.router.base}icons/icon-72x72.png`
  166. },
  167. {
  168. rel: 'apple-touch-icon',
  169. sizes: '96x96',
  170. href: `${routerBase.router.base}icons/icon-96x96.png`
  171. },
  172. {
  173. rel: 'apple-touch-icon',
  174. sizes: '144x144',
  175. href: `${routerBase.router.base}icons/icon-144x144.png`
  176. },
  177. {
  178. rel: 'apple-touch-icon',
  179. sizes: '192x192',
  180. href: `${routerBase.router.base}icons/icon-192x192.png`
  181. },
  182. ]
  183. },
  184. /*
  185. ** Customize the progress-bar color
  186. */
  187. loading: {
  188. color: 'var(--ac-color)'
  189. },
  190. /*
  191. ** Global CSS
  192. */
  193. css: [
  194. '@/assets/css/themes.scss',
  195. '@/assets/css/fonts.scss',
  196. '@/assets/css/styles.scss'
  197. ],
  198. /*
  199. ** Plugins to load before mounting the App
  200. */
  201. plugins: [
  202. {
  203. src: '~/plugins/vuex-persist'
  204. }
  205. ],
  206. /*
  207. ** Nuxt.js dev-modules
  208. */
  209. buildModules: [
  210. ],
  211. /*
  212. ** Nuxt.js modules
  213. */
  214. modules: [
  215. // See https://goo.gl/OOhYW5
  216. ['@nuxtjs/pwa', {
  217. manifest: {
  218. name: meta.name,
  219. short_name: meta.name,
  220. description: meta.shortDescription,
  221. display: "standalone",
  222. theme_color: "#252628",
  223. background_color: "#252628",
  224. start_url: `${routerBase.router.base}`,
  225. icons: ((sizes) => {
  226. let icons = [];
  227. for (let size of sizes) {
  228. icons.push({
  229. "src": `${routerBase.router.base}icons/icon-${size}x${size}.png`,
  230. "type": "image/png",
  231. "sizes": `${size}x${size}`
  232. });
  233. }
  234. return icons;
  235. })([48, 72, 96, 144, 192, 512])
  236. }
  237. }],
  238. ['@nuxtjs/axios'],
  239. ['@nuxtjs/toast']
  240. ],
  241. /*
  242. ** Build configuration
  243. */
  244. build: {
  245. /*
  246. ** You can extend webpack config here
  247. */
  248. extend(config, ctx) {}
  249. },
  250. /*
  251. ** Generate configuration
  252. */
  253. generate: {
  254. fallback: true
  255. },
  256. /*
  257. ** Router configuration
  258. */
  259. ...routerBase
  260. }