vue.config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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: '8001',
  20. //api地址前缀
  21. proxy: {
  22. '/weixin': {
  23. target: 'http://smart.cc-lotus.info',
  24. changeOrigin: true,
  25. ws: true,
  26. },
  27. '/files': {
  28. target: 'http://free.liaoningdoupo.com',
  29. },
  30. '/api': {
  31. target: 'http://free.liaoningdoupo.com',
  32. changeOrigin: true,
  33. ws: true,
  34. },
  35. '/ws': {
  36. target: 'http://free.liaoningdoupo.com',
  37. ws: true,
  38. },
  39. },
  40. },
  41. };