vue.config.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const path = require('path');
  2. const frame = path.resolve(__dirname, '../frame');
  3. const center = path.resolve(__dirname, '../train-center');
  4. module.exports = {
  5. publicPath: process.env.NODE_ENV === 'development' ? '/' : '/school',
  6. outputDir: 'school',
  7. configureWebpack: {
  8. // externals: {
  9. // 'element-ui': 'Element',
  10. // vue: 'Vue',
  11. // },
  12. // 开发生产共同配置
  13. resolve: {
  14. alias: {
  15. '@': path.resolve(__dirname, './src'),
  16. '@c': path.resolve(__dirname, './src/components'),
  17. '@a': path.resolve(__dirname, './src/assets'),
  18. '@frame': frame,
  19. '@center': center,
  20. },
  21. },
  22. },
  23. devServer: {
  24. port: '8005',
  25. //api地址前缀
  26. proxy: {
  27. '/api': {
  28. target: 'http://free.liaoningdoupo.com',
  29. changeOrigin: true,
  30. ws: true,
  31. },
  32. '/files': {
  33. target: 'http://free.liaoningdoupo.com',
  34. changeOrigin: true,
  35. ws: true,
  36. },
  37. '/ws': {
  38. target: 'http://free.liaoningdoupo.com',
  39. ws: true,
  40. },
  41. '/weixin': {
  42. target: 'http://smart.cc-lotus.info',
  43. changeOrigin: true,
  44. ws: true,
  45. },
  46. '/admin/center': {
  47. target: 'http://localhost:8001',
  48. },
  49. '/admin/director': {
  50. target: 'http://localhost:8002',
  51. },
  52. '/admin/teacher': {
  53. target: 'http://localhost:8003',
  54. },
  55. '/admin/student': {
  56. target: 'http://localhost:8004',
  57. },
  58. '/admin/school': {
  59. target: 'http://localhost:8005',
  60. },
  61. },
  62. },
  63. };