nuxt.config.js 1.9 KB

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