You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
5.4 KiB

3 years ago
  1. // const baseURL = function() {
  2. // switch (process.env.FLYLOCAL_ENV) {
  3. // case "prod":
  4. // return process.env.PROD_URL;
  5. // case "dev":
  6. // return process.env.DEV_URL;
  7. // case "local":
  8. // return "http://" + process.env.LOCAL_IP + ":" + process.env.LOCAL_PORT;
  9. // default:
  10. // break;
  11. // }
  12. // };
  13. export default {
  14. // env: {
  15. // baseURL: baseURL()
  16. // },
  17. // Global page headers: https://go.nuxtjs.dev/config-head
  18. head: {
  19. title: 'FlyLocal',
  20. meta: [
  21. { charset: 'utf-8' },
  22. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  23. { hid: 'description', name: 'description', content: 'FlyLocal is the best way to find local airlines that fly throughout the great state of Alaska. Explore the \'Last Frontier\' with FlyLocal.' },
  24. { name: 'format-detection', content: 'telephone=no' },
  25. { itemprop: 'name', content: 'Small Planes, Big Experiences' },
  26. { itemprop: 'description', content: 'FlyLocal is the best way to find local airlines that fly throughout the great state of Alaska. Explore the \'Last Frontier\' with FlyLocal.' },
  27. { itemprop: 'image', content: 'https://flylocal.us' + '/screenshot.png' },
  28. { property: 'og:url', content: 'https://flylocal.us' },
  29. { property: 'og:type', content: 'website' },
  30. { property: 'og:title', content: 'Small Planes, Big Experiences' },
  31. { property: 'og:description', content: 'FlyLocal is the best way to find local airlines that fly throughout the great state of Alaska. Explore the \'Last Frontier\' with FlyLocal.' },
  32. { property: 'og:image', content: 'https://flylocal.us' + '/screenshot.png' },
  33. { name: 'twitter:card', content: 'summary_large_image' },
  34. { name: 'twitter:title', content: 'Small Planes, Big Experiences' },
  35. { name: 'twitter:description', content: 'FlyLocal is the best way to find local airlines that fly throughout the great state of Alaska. Explore the \'Last Frontier\' with FlyLocal.' },
  36. { name: 'twitter:image', content: 'https://flylocal.us' + '/screenshot.png' }
  37. ],
  38. link: [
  39. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
  40. ]
  41. },
  42. server: (process.env.NODE_ENV !== 'production') ? {
  43. host: process.env.LOCAL_IP,
  44. port: process.env.LOCAL_PORT
  45. } : {},
  46. serverMiddleware: [
  47. { path: '/', handler: '~/middleware/redirects.js' },
  48. { path: '/login', handler: '~/login'},
  49. { path: '/clickout', handler: '~/middleware/postRequestHandler.js' },
  50. //{ path: '/flights', handler: '~/middleware/auth-guard.js'}
  51. ],
  52. // Global CSS: https://go.nuxtjs.dev/config-css
  53. css: [
  54. '~assets/css/main.css'
  55. ],
  56. // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  57. plugins: [
  58. { src: '~/plugins/vue2-leaflet-markercluster.js', mode: 'client' },
  59. '~plugins/v-mask.js',
  60. '~plugins/vue-phone-number-input.js',
  61. '~/plugins/env.js'
  62. ],
  63. // Auto import components: https://go.nuxtjs.dev/config-components
  64. components: true,
  65. router: {
  66. middleware: ['auth-guard'],
  67. extendRoutes (routes, resolve) {
  68. routes.push(
  69. // don't need to specify these when there are no params
  70. {
  71. name: 'go-orig-dest',
  72. path: '/go/:o/:d',
  73. component: resolve(__dirname, 'pages/go.vue')
  74. },
  75. {
  76. name: 'go-orig',
  77. path: '/go/:o',
  78. component: resolve(__dirname, 'pages/go.vue')
  79. },
  80. {
  81. name: 'dates-orig-dest',
  82. path: '/dates/:o/:d',
  83. component: resolve(__dirname, 'pages/dates.vue')
  84. },
  85. {
  86. name: 'flights-orig-dest-departure-time',
  87. path: '/flights/:o/:d/:departure/:time',
  88. component: resolve(__dirname, 'pages/flights.vue')
  89. },
  90. {
  91. name: 'flights-orig-dest-departure',
  92. path: '/flights/:o/:d/:departure',
  93. component: resolve(__dirname, 'pages/flights.vue')
  94. }
  95. )
  96. }
  97. },
  98. // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  99. buildModules: [
  100. // https://go.nuxtjs.dev/eslint
  101. //'@nuxtjs/eslint-module',
  102. // https://go.nuxtjs.dev/stylelint
  103. '@nuxtjs/stylelint-module',
  104. // https://go.nuxtjs.dev/tailwindcss
  105. '@nuxtjs/tailwindcss',
  106. '@nuxtjs/style-resources',
  107. '@nuxtjs/dotenv' // (environment variables)
  108. ],
  109. styleResources: {
  110. scss: [
  111. '~assets/scss/mixins.scss',
  112. '~assets/scss/variables.scss'
  113. ]
  114. },
  115. // Modules: https://go.nuxtjs.dev/config-modules
  116. modules: [
  117. // https://go.nuxtjs.dev/axios
  118. '@nuxtjs/axios',
  119. // https://go.nuxtjs.dev/pwa
  120. '@nuxtjs/pwa',
  121. 'nuxt-leaflet',
  122. 'nuxt-vue-select',
  123. [
  124. '@adinvadim/nuxt-segment-analytics',
  125. {
  126. id: (process.env.FLYLOCAL_ENV === 'prod') ? "QpcGXqVfScXUfRPbAGkbtyst6x5HNpRf" : "9dEbke7oGZjUCbF01hbcycoHxrpLvVBV",
  127. useRouter: true
  128. }
  129. ],
  130. ['cookie-universal-nuxt']
  131. ],
  132. // Axios module configuration: https://go.nuxtjs.dev/config-axios
  133. axios: {},
  134. // PWA module configuration: https://go.nuxtjs.dev/pwa
  135. pwa: {
  136. manifest: {
  137. lang: 'en'
  138. }
  139. },
  140. // Build Configuration: https://go.nuxtjs.dev/config-build
  141. build: {
  142. extend (config, ctx) {
  143. if (ctx.isDev) {
  144. config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map'
  145. }
  146. },
  147. loaders: {
  148. sass: {
  149. implementation: require('sass')
  150. },
  151. scss: {
  152. implementation: require('sass')
  153. }
  154. }
  155. },
  156. dev: process.env.NODE_ENV !== 'production'
  157. }