vue.config.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const path = require('path');
  2. module.exports = {
  3. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  4. // 打包文件
  5. outputDir: 'platlive',
  6. productionSourceMap: false,
  7. configureWebpack: config => {
  8. Object.assign(config, {
  9. // 开发生产共同配置
  10. resolve: {
  11. alias: {
  12. '@': path.resolve(__dirname, './src'),
  13. '@c': path.resolve(__dirname, './src/components'),
  14. '@a': path.resolve(__dirname, './src/assets'),
  15. },
  16. },
  17. });
  18. },
  19. devServer: {
  20. port: '8001',
  21. //api地址前缀
  22. proxy: {
  23. '/weixin': {
  24. target: 'http://smart.cc-lotus.info',
  25. changeOrigin: true,
  26. ws: true,
  27. },
  28. '/files': {
  29. target: 'http://free.liaoningdoupo.com',
  30. },
  31. '/api': {
  32. target: 'http://free.liaoningdoupo.com',
  33. changeOrigin: true,
  34. ws: true,
  35. },
  36. '/ws': {
  37. target: 'http://free.liaoningdoupo.com',
  38. ws: true,
  39. },
  40. },
  41. },
  42. };