vue.config.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. '/files': {
  27. target: 'http://free.liaoningdoupo.com',
  28. },
  29. '/api': {
  30. target: 'http://free.liaoningdoupo.com',
  31. changeOrigin: true,
  32. ws: true,
  33. },
  34. '/api/setting': {
  35. target: 'http://free.liaoningdoupo.com',
  36. changeOrigin: true,
  37. ws: true,
  38. },
  39. '/api/affairs': {
  40. target: 'http://free.liaoningdoupo.com',
  41. changeOrigin: true,
  42. ws: true,
  43. },
  44. '/api/policy': {
  45. target: 'http://free.liaoningdoupo.com',
  46. changeOrigin: true,
  47. ws: true,
  48. },
  49. '/api/record': {
  50. target: 'http://free.liaoningdoupo.com',
  51. changeOrigin: true,
  52. ws: true,
  53. },
  54. '/api/serve': {
  55. target: 'http://free.liaoningdoupo.com',
  56. changeOrigin: true,
  57. ws: true,
  58. },
  59. '/api/talent': {
  60. target: 'http://free.liaoningdoupo.com',
  61. changeOrigin: true,
  62. ws: true,
  63. },
  64. '/ws': {
  65. target: 'http://free.liaoningdoupo.com',
  66. ws: true,
  67. },
  68. },
  69. },
  70. };