vue.config.js 956 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. const path = require('path');
  2. module.exports = {
  3. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  4. configureWebpack: config => {
  5. Object.assign(config, {
  6. // 开发生产共同配置
  7. resolve: {
  8. alias: {
  9. '@': path.resolve(__dirname, './src'),
  10. '@c': path.resolve(__dirname, './src/components'),
  11. '@a': path.resolve(__dirname, './src/assets'),
  12. },
  13. },
  14. });
  15. },
  16. devServer: {
  17. port: '8001',
  18. //api地址前缀
  19. proxy: {
  20. '/weixin': {
  21. target: 'http://smart.cc-lotus.info',
  22. changeOrigin: true,
  23. ws: true,
  24. },
  25. '/files': {
  26. target: 'http://free.liaoningdoupo.com',
  27. },
  28. '/api': {
  29. target: 'http://free.liaoningdoupo.com',
  30. changeOrigin: true,
  31. ws: true,
  32. },
  33. '/ws': {
  34. target: 'http://free.liaoningdoupo.com',
  35. ws: true,
  36. },
  37. },
  38. },
  39. };