vue.config.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const { name } = require("./package.json");
  2. const { projectId } = require("./public/config2.js");
  3. let env = process.env.NODE_ENV.toString();
  4. console.log('env2', env);
  5. console.log('env2--name', name);
  6. console.log('env2---projectId', projectId);
  7. module.exports = {
  8. publicPath: '/sgshow', //相对路径
  9. outputDir: 'sgshow', //打包名称
  10. assetsDir: "static", //静态目录
  11. lintOnSave: false, //关闭lint代码
  12. productionSourceMap: false, // 生产环境是否开启sourceMap
  13. // 配置跨域
  14. devServer: {
  15. port: 8080, // 服务端口
  16. //https: false,
  17. //hotOnly: false,
  18. proxy: {
  19. "/daping": {
  20. // http://api.sagacloud.cn/duoduo-service/object-service/object/floor/queryFs
  21. //target: 'http://192.168.0.14:52021', // 接 口环境
  22. 'target': 'http://api.sagacloud.cn/', // 开发环境
  23. // target: 'http://test.persagy.com', // 测试环境
  24. changeOrigin: true,
  25. //logLevel: "debug",
  26. pathRewrite: {
  27. '^/daping': 'http://api.sagacloud.cn/', // 接口环境
  28. // '^/daping': 'http://192.168.0.14:52015', // 开发环境
  29. },
  30. },
  31. "/weather": {
  32. // http://api.sagacloud.cn/duoduo-service/object-service/object/floor/queryFs
  33. // target: 'http://192.168.0.14:52010', // 接 口环境
  34. 'target': 'https://duoduoenv.sagacloud.cn/', // 开发环境
  35. // target: 'http://test.persagy.com', // 测试环境
  36. changeOrigin: true,
  37. //logLevel: "debug",
  38. pathRewrite: {
  39. // '^/daping': 'http://192.168.0.14:52010', // 接口环境
  40. '^/weather': 'https://duoduoenv.sagacloud.cn/', // 开发环境
  41. },
  42. },
  43. },
  44. },
  45. };