vue.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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://free.liaoningdoupo.com',
  23. changeOrigin: true,
  24. ws: true,
  25. },
  26. '/files': {
  27. target: 'http://free.liaoningdoupo.com',
  28. },
  29. '/api': {
  30. target: 'http://free.liaoningdoupo.com',
  31. changeOrigin: true,
  32. ws: true,
  33. },
  34. '/wxtoken': {
  35. target: 'http://free.liaoningdoupo.com',
  36. changeOrigin: true,
  37. ws: true,
  38. pathRewrite: {
  39. '^/wxtoken': 'http://localhost:8002',
  40. },
  41. },
  42. '/ws': {
  43. target: 'http://free.liaoningdoupo.com',
  44. ws: true,
  45. },
  46. },
  47. },
  48. };