nuxt.config.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. },
  70. env: {
  71. NEWS_API_KEY: '2d199fb5095b44869cb4311a7a0366d2'
  72. },
  73. /*
  74. ** Build configuration
  75. */
  76. build: {
  77. /*
  78. ** You can extend webpack config here
  79. */
  80. extend (config, ctx) {
  81. if (ctx.dev && ctx.isClient) {
  82. config.module.rules.push({
  83. enforce: 'pre',
  84. test: /\.(js|vue)$/,
  85. loader: 'eslint-loader',
  86. exclude: /(node_modules)/,
  87. options: {
  88. fix: true
  89. }
  90. })
  91. }
  92. }
  93. }
  94. }