nuxt.config.js 1.8 KB

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