
import path from 'node:path';
import { defineConfig, loadConfigFromFile, loadEnv } from "vite";

import Components from "unplugin-vue-components/vite";



const config = defineConfig(({ command, mode, ssrBuild }) => {




    return {

        


        plugins: [
            Components({
                dirs: ["src/pc/components", "src/pc/pages/**/_components"],
                resolvers: [
                ],
                dts: "src/pc/components.d.ts",
            }),


        ],

        server: {
            port: 3333,
            proxy: {
                '/api': {
                    target: 'https://www.apdmagazine.com/', //测试服务器的
                    // target: 'http://127.0.0.1:9011/', //测试服务器的
                    changeOrigin: true,
                    ws: true,
                    pathRewrite: {
                        '^/api': ''
                    }
                }
            }

        },
    }
});

export default config;
