vue.config.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. const path = require('path');
  2. const resumeSrc = path.resolve(__dirname, '../web-common');
  3. module.exports = {
  4. publicPath: process.env.NODE_ENV === 'development' ? '/' : '/www',
  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. '@resume': resumeSrc,
  14. },
  15. },
  16. });
  17. },
  18. devServer: {
  19. port: '8004',
  20. //api地址前缀
  21. proxy: {
  22. '/api': {
  23. target: 'http://smart.cc-lotus.info',
  24. changeOrigin: true,
  25. ws: true,
  26. },
  27. '/bugInfo': {
  28. target: 'http://127.0.0.1:9001',
  29. ws: true,
  30. pathRewrite: {
  31. '^/bugInfo': '',
  32. },
  33. },
  34. '/ws': {
  35. target: 'http://smart.cc-lotus.info',
  36. ws: true,
  37. },
  38. '/weixin': {
  39. target: 'http://smart.cc-lotus.info',
  40. changeOrigin: true,
  41. ws: true,
  42. },
  43. '/files': {
  44. target: 'http://smart.cc-lotus.info',
  45. changeOrigin: true,
  46. ws: true,
  47. },
  48. '/loginProject': {
  49. target: 'http://localhost:8001',
  50. changeOrigin: true,
  51. ws: true,
  52. },
  53. '/studentProject': {
  54. target: 'http://localhost:8002',
  55. changeOrigin: true,
  56. ws: true,
  57. },
  58. '/corpProject': {
  59. target: 'http://localhost:8003',
  60. changeOrigin: true,
  61. ws: true,
  62. },
  63. },
  64. },
  65. };