vue.config.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const path = require('path');
  2. const question = path.resolve(__dirname, '../question-examine');
  3. const frame = path.resolve(__dirname, '../frame');
  4. const ip = 'http://127.0.0.1';
  5. module.exports = {
  6. publicPath: process.env.NODE_ENV === 'development' ? '/' : '/student',
  7. outputDir: 'student',
  8. configureWebpack: (config) => {
  9. Object.assign(config, {
  10. // 开发生产共同配置
  11. resolve: {
  12. alias: {
  13. '@': path.resolve(__dirname, './src'),
  14. '@c': path.resolve(__dirname, './src/components'),
  15. '@a': path.resolve(__dirname, './src/assets'),
  16. '@question': question,
  17. '@frame': frame,
  18. },
  19. },
  20. });
  21. },
  22. devServer: {
  23. port: '8001',
  24. //api地址前缀
  25. proxy: {
  26. '/files': {
  27. target: 'http://jytz.jilinjobs.cn',
  28. changeOrigin: true,
  29. ws: true,
  30. },
  31. '/ws': {
  32. target: 'http://jytz.jilinjobs.cn',
  33. ws: true,
  34. },
  35. '/weixin': {
  36. target: 'http://jytz.jilinjobs.cn',
  37. changeOrigin: true,
  38. ws: true,
  39. },
  40. '/api': {
  41. target: ip,
  42. changeOrigin: true,
  43. ws: true,
  44. },
  45. },
  46. },
  47. };