vue.config.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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: '7001',
  25. //api地址前缀
  26. proxy: {
  27. '/api/role/auth': {
  28. target: 'http://127.0.0.1:7002', //http://free.liaoningdoupo.com
  29. changeOrigin: true,
  30. ws: true,
  31. },
  32. '/files': {
  33. target: 'http://free.liaoningdoupo.com',
  34. },
  35. '/api': {
  36. target: 'http://free.liaoningdoupo.com',
  37. changeOrigin: true,
  38. ws: true,
  39. },
  40. '/ws': {
  41. target: 'http://free.liaoningdoupo.com',
  42. ws: true,
  43. },
  44. },
  45. },
  46. };