vue.config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. outputDir: 'platmobile',
  6. configureWebpack: config => {
  7. Object.assign(config, {
  8. // 开发生产共同配置
  9. resolve: {
  10. alias: {
  11. '@': path.resolve(__dirname, './src'),
  12. '@c': path.resolve(__dirname, './src/components'),
  13. '@a': path.resolve(__dirname, './src/assets'),
  14. '@common': common,
  15. },
  16. },
  17. });
  18. },
  19. devServer: {
  20. port: '8002',
  21. //api地址前缀
  22. proxy: {
  23. '/weixin': {
  24. target: 'http://broadcast.waityou24.cn',
  25. changeOrigin: true,
  26. ws: true,
  27. },
  28. '/files': {
  29. target: 'http://broadcast.waityou24.cn',
  30. },
  31. '/api': {
  32. target: 'http://broadcast.waityou24.cn',
  33. changeOrigin: true,
  34. ws: true,
  35. },
  36. '/wxtoken': {
  37. target: 'http://broadcast.waityou24.cn',
  38. changeOrigin: true,
  39. ws: true,
  40. // pathRewrite: {
  41. // '^/wxtoken': 'http://localhost:8002',
  42. // },
  43. },
  44. '/ws': {
  45. target: 'http://broadcast.waityou24.cn',
  46. ws: true,
  47. },
  48. },
  49. },
  50. };