vue.config.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. let proxy = {
  2. "/api": {
  3. target: "https://192.168.10.39:8878", // 考务 王伟
  4. changeOrigin: true
  5. }
  6. };
  7. // const stu = [
  8. // "/api/ecs_oe",
  9. // "/api/ecs_oe_student/",
  10. // "/api/sys_param",
  11. // "/api/exam_record",
  12. // "/api/exam_control",
  13. // "/api/exam_question",
  14. // "/api/exam_score",
  15. // "/api/practice_course",
  16. // "/api/practice_detail",
  17. // "/api/practice_record",
  18. // "/api/exam_captures",
  19. // "/api/face_capture",
  20. // "/api/face_verify",
  21. // "/api/offline_exam"
  22. // ];
  23. // for (const s of stu) {
  24. // proxy[s] = {
  25. // target: "http://ecs-dev.qmth.com.cn:8003", // 陈恳
  26. // changeOrigin: true
  27. // };
  28. // }
  29. // const mock = [{ source: "/api/mock/exam_question", dest: "/examQuestions" }];
  30. // for (const m of mock) {
  31. // proxy[m.source] = {
  32. // target: "http://localhost:3000/",
  33. // changeOrigin: true,
  34. // pathRewrite: {
  35. // ".*": m.dest
  36. // }
  37. // };
  38. // }
  39. var webpack = require("webpack");
  40. module.exports = {
  41. devServer: {
  42. proxy
  43. },
  44. chainWebpack: config => {
  45. // iview Loader
  46. config.module
  47. .rule("vue")
  48. .test(/\.vue$/)
  49. .use("iview-loader")
  50. .loader("iview-loader")
  51. .options({
  52. prefix: true
  53. })
  54. .end();
  55. },
  56. configureWebpack: {
  57. plugins: [
  58. // Ignore all locale files of moment.js
  59. // TODO: use webpack stats to check if iview locale matters
  60. new webpack.IgnorePlugin(/^\.\/locale$/, /moment|iview$/)
  61. ]
  62. }
  63. };