nuxt.config.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. ],
  36. /*
  37. ** Nuxt.js dev-modules
  38. */
  39. buildModules: [
  40. // Doc: https://github.com/nuxt-community/eslint-module
  41. '@nuxtjs/eslint-module'
  42. ],
  43. /*
  44. ** Nuxt.js modules
  45. */
  46. modules: [
  47. // Doc: https://axios.nuxtjs.org/usage
  48. '@nuxtjs/axios',
  49. '@nuxtjs/proxy'
  50. ],
  51. /*
  52. ** Axios module configuration
  53. ** See https://axios.nuxtjs.org/options
  54. */
  55. axios: {
  56. credentials: true,
  57. proxy: true
  58. },
  59. proxy: {
  60. '/api/': {
  61. target: 'https://newsapi.org/v2/',
  62. pathRewrite: { '^/api/': '' }
  63. },
  64. '/register/': {
  65. target: 'https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=AIzaSyCYndjau99Ugi0BhT5THKDKhR5XTCv_zw4',
  66. pathRewrite: { '^/register/': '' }
  67. }
  68. },
  69. env: {
  70. NEWS_API_KEY: '2d199fb5095b44869cb4311a7a0366d2'
  71. },
  72. /*
  73. ** Build configuration
  74. */
  75. build: {
  76. /*
  77. ** You can extend webpack config here
  78. */
  79. extend (config, ctx) {
  80. if (ctx.dev && ctx.isClient) {
  81. config.module.rules.push({
  82. enforce: 'pre',
  83. test: /\.(js|vue)$/,
  84. loader: 'eslint-loader',
  85. exclude: /(node_modules)/,
  86. options: {
  87. fix: true
  88. }
  89. })
  90. }
  91. }
  92. }
  93. }