nuxt.config.js 2.5 KB

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