vue.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const path = require('path');
  2. const common = path.resolve(__dirname, '../common');
  3. module.exports = {
  4. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  5. // 打包文件
  6. outputDir: 'liveAchieve',
  7. configureWebpack: config => {
  8. Object.assign(config, {
  9. // 开发生产共同配置
  10. resolve: {
  11. alias: {
  12. '@': path.resolve(__dirname, './src'),
  13. '@c': path.resolve(__dirname, './src/components'),
  14. '@a': path.resolve(__dirname, './src/assets'),
  15. '@common': common,
  16. },
  17. },
  18. });
  19. },
  20. devServer: {
  21. port: '8001',
  22. //api地址前缀
  23. proxy: {
  24. '/files': {
  25. target: 'http://broadcast.waityou24.cn',
  26. },
  27. '/api/live': {
  28. target: 'http://broadcast.waityou24.cn', //http://192.168.1.19:9101
  29. changeOrigin: true,
  30. ws: false,
  31. },
  32. '/api/achieve': {
  33. target: 'http://broadcast.waityou24.cn', //http://192.168.1.19:9103
  34. changeOrigin: true,
  35. ws: false,
  36. },
  37. '/ws': {
  38. target: 'http://broadcast.waityou24.cn',
  39. ws: false,
  40. },
  41. },
  42. },
  43. };