import type { UserConfigExport } from "@tarojs/cli";

export default {
  logger: {
    quiet: false,
    stats: true,
  },
  env: {
    NODE_ENV: '"development"',
  },
  defineConstants: {
    "process.env.TARO_APP_ID": '"wxa080848726642f73"',
    "process.env.TARO_API_DOMAIN":
      process.env.TARO_ENV === "h5"
        ? '"/api"'
        : '"http://api.erp.xunhong168.test"',
    "process.env.TARO_POSTER_DOMAIN":
      process.env.TARO_ENV === "h5"
        ? '""'
        : '"https://poster.qilincloud168.com"',
  },
  mini: {
    miniCssExtractPluginOption: {
      ignoreOrder: true,
    },
  },
  h5: {
    devServer: {
      proxy: {
        "/api/v1": {
          target: JSON.parse('"https://poster.qilincloud168.com"'),
          pathRewrite: { "^/api": "/api" },
          changeOrigin: true,
        },
        "/api/": {
          target: JSON.parse('"http://api.erp.xunhong168.test"'),
          pathRewrite: { "^/api": "/" },
          changeOrigin: true,
        },
      },
    },
  },
} satisfies UserConfigExport;
