vue.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const path = require('path');
  2. module.exports = {
  3. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  4. outputDir: 'platmobile',
  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. },
  14. },
  15. });
  16. },
  17. devServer: {
  18. port: '8002',
  19. //api地址前缀
  20. proxy: {
  21. '/weixin': {
  22. target: 'http://broadcast.waityou24.cn',
  23. changeOrigin: true,
  24. ws: true,
  25. },
  26. '/files': {
  27. target: 'http://broadcast.waityou24.cn',
  28. },
  29. '/api': {
  30. target: 'http://broadcast.waityou24.cn',
  31. // target: 'http://192.168.1.19:9004',
  32. changeOrigin: true,
  33. ws: true,
  34. },
  35. '/wxtoken': {
  36. target: 'http://broadcast.waityou24.cn',
  37. changeOrigin: true,
  38. ws: true,
  39. pathRewrite: {
  40. '^/wxtoken': 'http://localhost:8002',
  41. },
  42. },
  43. '/ws': {
  44. target: 'http://broadcast.waityou24.cn',
  45. ws: true,
  46. },
  47. },
  48. },
  49. };