vue.config.js 901 B

123456789101112131415161718192021222324252627282930
  1. const { defineConfig } = require("@vue/cli-service");
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. lintOnSave: false,
  5. pluginOptions: {
  6. electronBuilder: {
  7. externals: [],
  8. },
  9. },
  10. devServer: {
  11. open: false, // 编译完成是否打开网页
  12. host: "0.0.0.0", // 指定使用地址,默认localhost,0.0.0.0代表可以被外界访问
  13. port: 8080, // 访问端口
  14. https: false, // 编译失败时刷新页面
  15. hot: true, // 开启热加载
  16. proxy: {
  17. "/devApi": {
  18. // target: "http://ty.mxnzp.com/online_tools_api/",
  19. target: "http://127.0.0.1:8050/",
  20. // target: "http://tcl.mxnzp.com/tcl-translate/",
  21. // target: "https://www.cretinzp.com/jokes-web-manager/", //API服务器的地址
  22. changeOrigin: true,
  23. pathRewrite: {
  24. "^/devApi": "",
  25. },
  26. },
  27. }, // 设置代理
  28. },
  29. });