import cloudflare, {} from "@astrojs/cloudflare";
import { getPlatformProxyOptions } from "../cloudflare-env-proxy.js";
const isAstroCheck = !!process.argv.find((arg) => arg.includes("astro")) &&
    process.argv.includes("check");
const alchemy = (options) => {
    const integration = cloudflare({
        platformProxy: getPlatformProxyOptions(options?.platformProxy, !isAstroCheck),
        ...options,
    });
    const setup = integration.hooks["astro:config:setup"];
    integration.hooks["astro:config:setup"] = async (options) => {
        options.updateConfig({
            vite: {
                server: {
                    watch: {
                        ignored: ["**/.alchemy/**"],
                    },
                },
            },
        });
        await setup?.(options);
    };
    return integration;
};
export default alchemy;
//# sourceMappingURL=plugin.js.map