vue.config.js 982 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. // 打包文件
  6. outputDir: 'liveadmin',
  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. '@common': common,
  16. },
  17. },
  18. });
  19. },
  20. devServer: {
  21. port: '8001',
  22. //api地址前缀
  23. proxy: {
  24. '/files': {
  25. target: 'http://broadcast.kqyjy.com',
  26. },
  27. '/api': {
  28. target: 'http://broadcast.kqyjy.com', //http://192.168.1.19:9101
  29. changeOrigin: true,
  30. ws: false,
  31. },
  32. '/ws': {
  33. target: 'http://broadcast.kqyjy.com',
  34. ws: false,
  35. },
  36. },
  37. },
  38. };