vue.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const path = require('path');
  2. const frame = path.resolve(__dirname, '../frame');
  3. const layouts = path.resolve(__dirname, '../frame/layouts');
  4. module.exports = {
  5. // publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  6. publicPath: process.env.VUE_APP_ROUTER,
  7. // 打包文件
  8. outputDir: 'zhwl',
  9. configureWebpack: config => {
  10. Object.assign(config, {
  11. // 开发生产共同配置
  12. resolve: {
  13. alias: {
  14. '@': path.resolve(__dirname, './src'),
  15. '@c': path.resolve(__dirname, './src/components'),
  16. '@a': path.resolve(__dirname, './src/assets'),
  17. '@l': layouts,
  18. '@f': frame,
  19. },
  20. },
  21. });
  22. },
  23. devServer: {
  24. port: '7002',
  25. //api地址前缀
  26. proxy: {
  27. '/api/servicezhwl': {
  28. target: 'http://127.0.0.1:7001',
  29. },
  30. '/api/role/auth': {
  31. target: 'http://broadcast.waityou24.cn/', //http://broadcast.waityou24.cn/
  32. changeOrigin: true,
  33. ws: true,
  34. },
  35. '/files': {
  36. target: 'http://broadcast.waityou24.cn/',
  37. },
  38. '/ws': {
  39. target: 'http://broadcast.waityou24.cn/',
  40. ws: true,
  41. },
  42. },
  43. },
  44. };