vue.config.js 1.3 KB

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