vue.config.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. const path = require('path');
  2. const common = path.resolve(__dirname, '../common');
  3. module.exports = {
  4. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  5. // 打包文件
  6. outputDir: 'platlive',
  7. configureWebpack: config => {
  8. Object.assign(config, {
  9. // 开发生产共同配置
  10. resolve: {
  11. alias: {
  12. '@': path.resolve(__dirname, './src'),
  13. '@c': path.resolve(__dirname, './src/components'),
  14. '@a': path.resolve(__dirname, './src/assets'),
  15. '@common': common,
  16. },
  17. },
  18. });
  19. },
  20. devServer: {
  21. port: '8001',
  22. //api地址前缀
  23. proxy: {
  24. '/weixin': {
  25. target: 'http://smart.cc-lotus.info',
  26. changeOrigin: true,
  27. ws: true,
  28. },
  29. '/files': {
  30. target: 'http://free.liaoningdoupo.com',
  31. },
  32. '/api': {
  33. target: 'http://free.liaoningdoupo.com',
  34. changeOrigin: true,
  35. ws: true,
  36. },
  37. // '/api/setting': {
  38. // target: 'http://free.liaoningdoupo.com',
  39. // // target: 'http://free.liaoningdoupo.com', //http://free.liaoningdoupo.com
  40. // changeOrigin: true,
  41. // ws: true,
  42. // },
  43. // '/api/affairs': {
  44. // target: 'http://free.liaoningdoupo.com',
  45. // changeOrigin: true,
  46. // ws: true,
  47. // },
  48. // '/api/policy': {
  49. // target: 'http://free.liaoningdoupo.com',
  50. // changeOrigin: true,
  51. // ws: true,
  52. // },
  53. // '/api/record': {
  54. // target: 'http://free.liaoningdoupo.com',
  55. // changeOrigin: true,
  56. // ws: true,
  57. // },
  58. // '/api/serve': {
  59. // target: 'http://free.liaoningdoupo.com',
  60. // changeOrigin: true,
  61. // ws: true,
  62. // // pathRewrite: { '^/api/affairs': '/api' },
  63. // },
  64. // '/api/talent': {
  65. // target: 'http://free.liaoningdoupo.com',
  66. // changeOrigin: true,
  67. // ws: true,
  68. // // pathRewrite: { '^/api/affairs': '/api' },
  69. // },
  70. // '/api/market': {
  71. // target: 'http://free.liaoningdoupo.com',
  72. // changeOrigin: true,
  73. // ws: true,
  74. // // pathRewrite: { '^/api/affairs': '/api' },
  75. // },
  76. // '/api/live': {
  77. // target: 'http://free.liaoningdoupo.com',
  78. // changeOrigin: true,
  79. // ws: true,
  80. // // pathRewrite: { '^/api/affairs': '/api' },
  81. // },
  82. '/ws': {
  83. target: 'http://free.liaoningdoupo.com',
  84. ws: true,
  85. },
  86. },
  87. },
  88. };