vue.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. 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. '@common': common,
  14. },
  15. },
  16. });
  17. },
  18. devServer: {
  19. port: '8100',
  20. //api地址前缀
  21. proxy: {
  22. '/weixin': {
  23. target: 'https://zb.liaoningdoupo.com',
  24. changeOrigin: true,
  25. ws: true,
  26. },
  27. '/files': {
  28. target: 'https://zb.liaoningdoupo.com',
  29. },
  30. '/api': {
  31. target: 'https://zb.liaoningdoupo.com',
  32. changeOrigin: true,
  33. ws: true,
  34. },
  35. '/wxtoken': {
  36. target: 'https://zb.liaoningdoupo.com',
  37. changeOrigin: true,
  38. ws: true,
  39. pathRewrite: {
  40. '^/wxtoken': 'http://localhost:8002',
  41. },
  42. },
  43. '/ws': {
  44. target: 'https://zb.liaoningdoupo.com',
  45. ws: true,
  46. },
  47. },
  48. },
  49. };