vue.config.js 896 B

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