vue.config.js 2.2 KB

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