vue.config.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const path = require('path');
  2. const question = path.resolve(__dirname, '../question-examine');
  3. module.exports = {
  4. publicPath: '/',
  5. configureWebpack: config => {
  6. Object.assign(config, {
  7. // 开发生产共同配置
  8. resolve: {
  9. alias: {
  10. '@': path.resolve(__dirname, './src'),
  11. '@c': path.resolve(__dirname, './src/components'),
  12. '@a': path.resolve(__dirname, './src/assets'),
  13. '@question': question,
  14. },
  15. },
  16. });
  17. },
  18. devServer: {
  19. port: '8001',
  20. //api地址前缀
  21. proxy: {
  22. '/files': {
  23. target: 'http://smart.cc-lotus.info',
  24. changeOrigin: true,
  25. ws: true,
  26. },
  27. '/ws': {
  28. target: 'http://smart.cc-lotus.info',
  29. ws: true,
  30. },
  31. '/weixin': {
  32. target: 'http://smart.cc-lotus.info',
  33. changeOrigin: true,
  34. ws: true,
  35. },
  36. '/api': {
  37. target: 'http://free.liaoningdoupo.com',
  38. changeOrigin: true,
  39. ws: true,
  40. },
  41. },
  42. },
  43. };