vue.config.js 2.0 KB

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