nuxt.config.js 6.1 KB

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