vue.config.js 1.6 KB

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