vue.config.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. const path = require('path');
  2. const publics = path.resolve(__dirname, '../web-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. '@publics': publics,
  14. },
  15. },
  16. });
  17. },
  18. devServer: {
  19. port: '8003',
  20. //api地址前缀
  21. proxy: {
  22. '/api': {
  23. target: 'http://smart.cc-lotus.info',
  24. ws: true,
  25. },
  26. '/files': {
  27. target: 'http://smart.cc-lotus.info',
  28. ws: true,
  29. },
  30. '/ws': {
  31. target: 'http://smart.cc-lotus.info',
  32. ws: true,
  33. },
  34. '/weixin': {
  35. target: 'http://smart.cc-lotus.info',
  36. ws: true,
  37. },
  38. '/adminapi': {
  39. target: 'http://10.16.5.15:8101',
  40. ws: true,
  41. pathRewrite: { '^/adminapi': '/api' },
  42. },
  43. '/napi': {
  44. target: 'http://10.16.11.186:8102',
  45. ws: true,
  46. pathRewrite: { '^/napi': '/api' },
  47. },
  48. },
  49. },
  50. };