vue.config.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. // const plugins = [];
  41. // Ignore all locale files of moment.js
  42. // TODO: use webpack stats to check if iview locale matters
  43. // plugins.push();
  44. // if (process.env.NODE_ENV === "production") {
  45. // plugins.push("transform-remove-console");
  46. // }
  47. module.exports = {
  48. lintOnSave: process.env.NODE_ENV !== "production" ? true : "error",
  49. devServer: {
  50. proxy,
  51. },
  52. chainWebpack: config => {
  53. // iview Loader
  54. config.module
  55. .rule("vue")
  56. .test(/\.vue$/)
  57. .use("iview-loader")
  58. .loader("iview-loader")
  59. .options({
  60. prefix: true,
  61. })
  62. .end();
  63. },
  64. configureWebpack: {
  65. devtool: "source-map",
  66. plugins: [new webpack.IgnorePlugin(/^\.\/locale$/, /moment|iview$/)],
  67. },
  68. };