vue.config.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. const path = require('path');
  2. const frame = path.resolve(__dirname, '../frame');
  3. const school = path.resolve(__dirname, '../train-school');
  4. module.exports = {
  5. publicPath: process.env.NODE_ENV === 'development' ? '/' : '/center',
  6. outputDir: 'center',
  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. '@school': school,
  20. },
  21. },
  22. },
  23. devServer: {
  24. port: '8002',
  25. //api地址前缀
  26. proxy: {
  27. '/api/train': {
  28. target: 'http://free.liaoningdoupo.com', ///api/train
  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. '/jh': {
  47. //聚合科技API
  48. target: 'http://v.juhe.cn',
  49. changeOrigin: true,
  50. ws: true,
  51. pathRewrite: {
  52. '^/jh': '',
  53. },
  54. },
  55. },
  56. },
  57. };