vue.config.js 938 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * @Description: 跨域
  3. * @Author: gaomingxin
  4. * @Date: 2023-05-27 21:37:29
  5. * @LastEditors: gaomingxin
  6. * @LastEditTime: 2023-06-15 16:50:35
  7. */
  8. module.exports = {
  9. devServer: {
  10. port: 8080, // 前端端口号
  11. open: true,
  12. // host:'localhost',
  13. proxy: {
  14. "/api": {
  15. // target: "http://192.168.1.107:8089/api",
  16. // target: "http://192.168.1.104:8087/api",
  17. target: "http://192.168.80.58:11178/api",
  18. changeOrigin: true,
  19. pathRewrite: {
  20. "^/api": "",
  21. },
  22. },
  23. },
  24. },
  25. css: {
  26. loaderOptions: {
  27. sass: {
  28. // 全局sass变量
  29. //sass-loader 新版本
  30. additionalData: `@import "~@/assets/sass/index.scss";`,
  31. },
  32. },
  33. },
  34. // // ES6兼容配置:在exports中添加,这里很关键,不配置不行
  35. // transpileDependencies : [/node_modules\\d3\S*\\/,'delaunator'],
  36. };