nuxt.config.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. { charset: 'utf-8' },
  31. { name: 'viewport', content: 'width=device-width, initial-scale=1, minimum-scale=1, shrink-to-fit=no, minimal-ui' },
  32. { hid: 'description', name: 'description', content: meta.description || '' },
  33. { name: 'keywords', content: 'postwoman, api, request, testing, tool, rest, websocket'},
  34. { name: 'X-UA-Compatible', content: "IE=edge, chrome=1" },
  35. { itemprop: "name", content: `${meta.name} \u2022 ${meta.shortDescription}` },
  36. { itemprop: "description", content: meta.description },
  37. { itemprop: "image", content: `${routerBase.router.base}icons/icon-192x192.png` },
  38. // Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
  39. { name: 'application-name', content: meta.name },
  40. // Add to homescreen for Safari on iOS
  41. { name: 'apple-mobile-web-app-capable', content: 'yes' },
  42. { name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
  43. { name: 'apple-mobile-web-app-title', content: meta.name },
  44. // Windows phone tile icon
  45. { name: 'msapplication-TileImage', content: `${routerBase.router.base}icons/icon-144x144.png` },
  46. { name: 'msapplication-TileColor', content: '#121212' },
  47. { name: 'msapplication-tap-highlight', content: 'no' },
  48. // OpenGraph
  49. { property: 'og:site_name', content: meta.name },
  50. { property: 'og:url', content: 'https://liyasthomas.github.io/postwoman' },
  51. { property: 'og:type', content: 'website' },
  52. { property: 'og:title', content: `${meta.name} \u2022 ${meta.shortDescription}` },
  53. { property: 'og:description', content: meta.description },
  54. { property: 'og:image', content: `${routerBase.router.base}icons/icon-144x144.png` },
  55. // Twitter
  56. { name: 'twitter:card', content: "summary" },
  57. { name: 'twitter:site', content: "@liyasthomas" },
  58. { name: 'twitter:creator', content: "@liyasthomas" },
  59. { name: 'twitter:url', content: "https://liyasthomas.github.io/postwoman" },
  60. { name: 'twitter:title', content: meta.name },
  61. { name: 'twitter:description', content: meta.shortDescription },
  62. { name: 'twitter:image', content: `${routerBase.router.base}icons/icon-144x144.png` },
  63. ],
  64. link: [
  65. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  66. // Home-screen icons (iOS)
  67. { rel: 'apple-touch-icon', href: `${routerBase.router.base}icons/icon-48x48.png` },
  68. { rel: 'apple-touch-icon', sizes: '72x72', href: `${routerBase.router.base}icons/icon-72x72.png` },
  69. { rel: 'apple-touch-icon', sizes: '96x96', href: `${routerBase.router.base}icons/icon-96x96.png` },
  70. { rel: 'apple-touch-icon', sizes: '144x144', href: `${routerBase.router.base}icons/icon-144x144.png` },
  71. { rel: 'apple-touch-icon', sizes: '192x192', href: `${routerBase.router.base}icons/icon-192x192.png` },
  72. ]
  73. },
  74. /*
  75. ** Customize the progress-bar color
  76. */
  77. loading: { color: 'var(--ac-color)' },
  78. /*
  79. ** Global CSS
  80. */
  81. css: [
  82. '@/assets/css/themes.scss',
  83. '@/assets/css/fonts.scss',
  84. '@/assets/css/styles.scss'
  85. ],
  86. /*
  87. ** Plugins to load before mounting the App
  88. */
  89. plugins: [
  90. { src: '~/plugins/vuex-persist' }
  91. ],
  92. /*
  93. ** Nuxt.js dev-modules
  94. */
  95. buildModules: [
  96. ],
  97. /*
  98. ** Nuxt.js modules
  99. */
  100. modules: [
  101. // See https://goo.gl/OOhYW5
  102. ['@nuxtjs/pwa', {
  103. manifest: {
  104. name: meta.name,
  105. short_name: meta.name,
  106. description: meta.shortDescription,
  107. display: "standalone",
  108. theme_color: "#121212",
  109. background_color: "#121212",
  110. icons: ((sizes) => {
  111. let icons = [];
  112. for(let size of sizes){
  113. icons.push({
  114. "src": `${routerBase.router.base}icons/icon-${size}x${size}.png`,
  115. "type": "image/png",
  116. "sizes": `${size}x${size}`
  117. });
  118. }
  119. return icons;
  120. })([48, 72, 96, 144, 192, 512])
  121. }
  122. }],
  123. ['@nuxtjs/axios']
  124. ],
  125. /*
  126. ** Build configuration
  127. */
  128. build: {
  129. /*
  130. ** You can extend webpack config here
  131. */
  132. extend (config, ctx) {
  133. }
  134. },
  135. /*
  136. ** Generate configuration
  137. */
  138. generate: {
  139. fallback: true
  140. },
  141. /*
  142. ** Router configuration
  143. */
  144. ...routerBase
  145. }