vue.config.js 2.6 KB

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