const path = require("path");
const resolve = (dir) => {
  return path.join(__dirname, dir);
};
module.exports = {
  publicPath: "./",
  lintOnSave: false,
  devServer: {
    port: 8080,
    proxy: {
      "/prod-api": {
        target: "http://111.172.230.93:9876", // 后台接口域名
        changeOrigin: true, // 开启代理，在本地创建一个虚拟服务端
        pathRewrite: {
          "^/prod-api": "", // 重写路径，去掉路径前缀 '/api'
        },
      },
    },
  },
  chainWebpack: (config) => {
    config.resolve.alias.set("_c", resolve("src/components")); // key,value自行定义，比如.set('@@', resolve('src/components'))
  },
};
