nuxt.config.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. export default {
  2. mode: 'spa',
  3. router: {
  4. middleware: 'check-auth'
  5. },
  6. /*
  7. ** Headers of the page
  8. */
  9. head: {
  10. title: process.env.npm_package_name || '',
  11. meta: [
  12. { charset: 'utf-8' },
  13. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  14. { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
  15. ],
  16. link: [
  17. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  18. { rel: 'stylecss', href: '//fonts.googleapis.com/css?family=Roboto:400,500,700,400italic|Material+Icons' }
  19. ]
  20. },
  21. /*
  22. ** Customize the progress-bar color
  23. */
  24. loading: { color: '#9ccc65', height: '10px' },
  25. /*
  26. ** Global CSS
  27. */
  28. css: [
  29. { src: 'vue-material/dist/vue-material.min.css', lang: 'css' },
  30. { src: '~/assets/theme.scss', lang: 'scss' }
  31. ],
  32. /*
  33. ** Plugins to load before mounting the App
  34. */
  35. plugins: [
  36. { src: '~/plugins/vue-material' },
  37. { src: '~/plugins/axios' },
  38. { src: '~/plugins/firestore' }
  39. ],
  40. /*
  41. ** Nuxt.js dev-modules
  42. */
  43. buildModules: [
  44. // Doc: https://github.com/nuxt-community/eslint-module
  45. '@nuxtjs/eslint-module'
  46. ],
  47. /*
  48. ** Nuxt.js modules
  49. */
  50. modules: [
  51. // Doc: https://axios.nuxtjs.org/usage
  52. '@nuxtjs/axios',
  53. '@nuxtjs/proxy'
  54. ],
  55. /*
  56. ** Axios module configuration
  57. ** See https://axios.nuxtjs.org/options
  58. */
  59. axios: {
  60. credentials: true,
  61. proxy: true
  62. },
  63. proxy: {
  64. '/api/': {
  65. target: 'https://newsapi.org/v2/',
  66. pathRewrite: { '^/api/': '' }
  67. },
  68. '/register/': {
  69. target: 'https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=AIzaSyCYndjau99Ugi0BhT5THKDKhR5XTCv_zw4',
  70. pathRewrite: { '^/register/': '' }
  71. },
  72. '/login/': {
  73. target: 'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=AIzaSyCYndjau99Ugi0BhT5THKDKhR5XTCv_zw4',
  74. pathRewrite: { '^/login/': '' }
  75. }
  76. },
  77. env: {
  78. NEWS_API_KEY: '2d199fb5095b44869cb4311a7a0366d2'
  79. },
  80. /*
  81. ** Build configuration
  82. */
  83. build: {
  84. /*
  85. ** You can extend webpack config here
  86. */
  87. extend (config, ctx) {
  88. if (ctx.dev && ctx.isClient) {
  89. config.module.rules.push({
  90. enforce: 'pre',
  91. test: /\.(js|vue)$/,
  92. loader: 'eslint-loader',
  93. exclude: /(node_modules)/,
  94. options: {
  95. fix: true
  96. }
  97. })
  98. }
  99. }
  100. }
  101. }