vue.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const path = require('path');
  2. const question = path.resolve(__dirname, '../question-examine');
  3. const frame = path.resolve(__dirname, '../frame');
  4. module.exports = {
  5. publicPath: process.env.NODE_ENV === 'development' ? '/' : '/mobiledirtea',
  6. outputDir: 'mobiledirtea',
  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. '@question': question,
  16. '@frame': frame,
  17. },
  18. },
  19. });
  20. },
  21. devServer: {
  22. port: '8200',
  23. //api地址前缀
  24. proxy: {
  25. '/files': {
  26. target: 'http://free.liaoningdoupo.com',
  27. changeOrigin: true,
  28. ws: true,
  29. },
  30. '/ws': {
  31. target: 'http://free.liaoningdoupo.com',
  32. ws: true,
  33. },
  34. '/weixin': {
  35. target: 'http://smart.cc-lotus.info',
  36. changeOrigin: true,
  37. ws: true,
  38. },
  39. '/api': {
  40. target: 'http://free.liaoningdoupo.com',
  41. changeOrigin: true,
  42. ws: true,
  43. },
  44. },
  45. },
  46. };