vue.config.js 957 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. const { defineConfig } = require("@vue/cli-service");
  2. const { resolve } = require("path");
  3. const port = 9010;
  4. const name = "退役军人职业教育基地";
  5. module.exports = defineConfig({
  6. transpileDependencies: true,
  7. lintOnSave: false,
  8. outputDir: process.env.ENV + "-dist",
  9. devServer: {
  10. host: "0.0.0.0",
  11. port,
  12. proxy: {
  13. // 开发模式请求基础api反代理
  14. [process.env.VUE_APP_BASE_API]: {
  15. // target: `https://wx.hw.hongweisoft.com/veterans`,
  16. target: `http://gateway.veterans.hongweisoft.com/veterans-prod-api`,
  17. changeOrigin: true,
  18. pathRewrite: {
  19. ["^" + process.env.VUE_APP_BASE_API]: "",
  20. },
  21. }
  22. },
  23. },
  24. configureWebpack: {
  25. name,
  26. resolve: {
  27. alias: {
  28. "@": resolve("src"),
  29. },
  30. },
  31. },
  32. chainWebpack(config) {
  33. config.plugin("html").tap((args) => {
  34. // 标题
  35. args[0].title = name;
  36. return args;
  37. });
  38. },
  39. });