vue.config.js 902 B

123456789101112131415161718192021222324252627282930313233343536
  1. const path = require("path");
  2. // const name = "教室预约";
  3. // function resolve(dir) {
  4. // return path.join(__dirname, dir);
  5. // }
  6. module.exports = {
  7. // 配置路径别名
  8. configureWebpack: {
  9. // resolve: {
  10. // alias: {
  11. // "ss": resolve("pages/mine/mine"),
  12. // },
  13. // },
  14. //代理
  15. devServer: {
  16. "port": 8080,
  17. // 调试时允许内网穿透,让外网的人访问到本地调试的H5页面
  18. disableHostCheck: true,
  19. "proxy": {
  20. "/api": {
  21. // "target": "https://mentor.site.ximengnaikang.com", // 需要跨域的域名
  22. // "target":'http://77ff-1-198-30-100.ngrok.io',
  23. "target": "https://api.qunali.site.xmnk.cn/api", // 需要跨域的域名
  24. "changeOrigin": true,
  25. "secure": false,
  26. "pathRewrite": {
  27. "^/api": "" //匹配请求路径里面有 /api 替换成 https://www.xxx.cn
  28. }
  29. }
  30. }
  31. },
  32. //productionSourceMap: false,
  33. },
  34. }