vue.config.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. const path = require("path");
  2. function resolve(dir) {
  3. return path.join(__dirname, dir);
  4. }
  5. const pubPath =
  6. process.env.NODE_ENV === "development" ? "./" : "http://oyweb.ouj.com/other/shop-popularize/";
  7. module.exports = {
  8. publicPath: pubPath,
  9. chainWebpack: config => {
  10. // 设置别名
  11. config.resolve.alias.set("@", resolve("src"));
  12. },
  13. outputDir:"../../build/other/shop-popularize",
  14. devServer: {
  15. // 疯狂丢cookie 还是代理了没啥事
  16. proxy: {
  17. //配置代理
  18. "/api": {
  19. target: "http://pgame.ouj.com/hdCenter", //请求测试地址
  20. // target: "http://pageapi.webdev2.duowan.com/hdCenter", // 线上地址
  21. ws: true, //是否代理
  22. changeOrigin: true, //是否跨域
  23. pathRewrite: {
  24. "^/api": ""
  25. }
  26. }
  27. },
  28. disableHostCheck: true, // 内网穿透,设置了才能访问
  29. watchOptions: {
  30. ignored: /node_modules/,
  31. aggregateTimeout: 300, //文件变动后多久发起构建,越大越好
  32. poll: 1000 //每秒询问次数,越小越好
  33. }
  34. }
  35. };