const { defineConfig } = require("@vue/cli-service");
const { resolve } = require("path");
const port = 9010;
const name = "退役军人职业教育基地";
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  outputDir: process.env.ENV + "-dist",
  devServer: {
    host: "0.0.0.0",
    port,
    proxy: {
      // 开发模式请求基础api反代理
      [process.env.VUE_APP_BASE_API]: {
        target: `https://wx.hw.hongweisoft.com/veterans`,
        // target: `http://gateway.veterans.hongweisoft.com/veterans-prod-api`,
        changeOrigin: true,
        pathRewrite: {
          ["^" + process.env.VUE_APP_BASE_API]: "",
        },
      }
    },
  },
  configureWebpack: {
    name,
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },
  },
  chainWebpack(config) {
    config.plugin("html").tap((args) => {
      // 标题
      args[0].title = name;
      return args;
    });
  },
});
