nuxt.config.js 2.3 KB

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