vue.config.js 849 B

12345678910111213141516171819202122232425262728293031323334353637
  1. const { defineConfig } = require("@vue/cli-service");
  2. const path = require("path");
  3. module.exports = defineConfig({
  4. transpileDependencies: true,
  5. lintOnSave: false,
  6. devServer: {
  7. client: {
  8. overlay: false // 编译错误时,取消全屏覆盖(建议关掉)
  9. },
  10. // port: 8080,
  11. // host: "localhost",
  12. // https: false,
  13. // open: true,
  14. proxy: {
  15. "/admin": {
  16. target: process.env.VUE_APP_BASE_URL,
  17. ws: true,
  18. changeOrigin: true,
  19. pathRewrite: {
  20. "^/admin": "/admin"
  21. }
  22. },
  23. "/api": {
  24. target: 'http://192.168.1.108:8083',
  25. ws: true,
  26. changeOrigin: true,
  27. pathRewrite: {
  28. "^/api": ""
  29. }
  30. }
  31. }
  32. },
  33. chainWebpack: (config) => {
  34. config.resolve.alias.set("@", path.resolve(__dirname, "src"));
  35. }
  36. });