nuxt.config.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. const pkg = require('./package')
  2. module.exports = {
  3. mode: 'universal',
  4. /**
  5. * 打包文件
  6. */
  7. build: {
  8. vendor: ['axios', 'element-ui']
  9. },
  10. server: {
  11. },
  12. /*
  13. ** Headers of the page
  14. */
  15. head: {
  16. title: '程序员客栈',
  17. meta: [
  18. { charset: 'utf-8' },
  19. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  20. { name: 'baidu-site-verification', content: '7IbkIN9Kwp' },
  21. { 'http-equiv': 'X-UA-Compatible', content: 'IE=edge,chrome=1' },
  22. // hid: 'x', 可在页面内覆盖这里
  23. { name: 'robots', content: 'noindex,follow' },
  24. { name: 'description', content: pkg.description }
  25. ],
  26. link: [
  27. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
  28. ]
  29. },
  30. /*
  31. ** Customize the progress-bar color
  32. */
  33. loading: { color: '#fff' },
  34. /*
  35. ** Global CSS
  36. */
  37. css: [
  38. '@/assets/css/common.css'
  39. ],
  40. /*
  41. ** Plugins to load before mounting the App
  42. */
  43. plugins: [
  44. 'plugins/element',
  45. 'plugins/http',
  46. ],
  47. /*
  48. ** Axios module configuration
  49. */
  50. axios: {
  51. // See https://github.com/nuxt-community/axios-module#options
  52. proxy: true
  53. },
  54. /**
  55. * Proxy
  56. */
  57. proxy: [
  58. ['/api', { target: 'https://dev.test.proginn.com', changeOrigin: true }],
  59. ['/image', { target: 'https://stacdn.proginn.com', changeOrigin: true }],
  60. ],
  61. /*
  62. ** Nuxt.js modules
  63. */
  64. modules: [
  65. '@nuxtjs/axios',
  66. '@nuxtjs/proxy',
  67. ],
  68. /*
  69. ** Build configuration
  70. */
  71. build: {
  72. /*
  73. ** You can extend webpack config here
  74. */
  75. extend(config, ctx) {
  76. }
  77. }
  78. }