vue.config.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: '8001',
  21. //api地址前缀
  22. proxy: {
  23. '/weixin': {
  24. target: 'http://smart.cc-lotus.info',
  25. changeOrigin: true,
  26. ws: true,
  27. },
  28. // '/api': {
  29. // target: 'http://smart.cc-lotus.info',
  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://10.16.10.72:9000',
  42. // changeOrigin: true,
  43. // ws: true,
  44. // },
  45. // '/api/affairs': {
  46. // target: 'http://free.liaoningdoupo.com',
  47. // changeOrigin: true,
  48. // ws: true,
  49. // },
  50. // '/api/policy': {
  51. // target: 'http://free.liaoningdoupo.com',
  52. // changeOrigin: true,
  53. // ws: true,
  54. // },
  55. // '/api/record': {
  56. // target: 'http://free.liaoningdoupo.com',
  57. // changeOrigin: true,
  58. // ws: true,
  59. // },
  60. // '/api/serve': {
  61. // target: 'http://free.liaoningdoupo.com',
  62. // changeOrigin: true,
  63. // ws: true,
  64. // // pathRewrite: { '^/api/affairs': '/api' },
  65. // },
  66. // '/api/talent': {
  67. // target: 'http://free.liaoningdoupo.com',
  68. // changeOrigin: true,
  69. // ws: true,
  70. // // pathRewrite: { '^/api/affairs': '/api' },
  71. // },
  72. // '/api/market': {
  73. // target: 'http://free.liaoningdoupo.com',
  74. // changeOrigin: true,
  75. // ws: true,
  76. // // pathRewrite: { '^/api/affairs': '/api' },
  77. // },
  78. // '/api/live': {
  79. // target: 'http://free.liaoningdoupo.com',
  80. // changeOrigin: true,
  81. // ws: true,
  82. // // pathRewrite: { '^/api/affairs': '/api' },
  83. // },
  84. },
  85. },
  86. };