@redwoodjs/sdk
Version:
Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime
13 lines (12 loc) • 457 B
JavaScript
import { pathExists } from "fs-extra";
import { resolve } from "path";
export const findWranglerConfig = async (projectRootDir) => {
const configFiles = ["wrangler.jsonc", "wrangler.json", "wrangler.toml"];
for (const file of configFiles) {
const fullPath = resolve(projectRootDir, file);
if (await pathExists(fullPath)) {
return fullPath;
}
}
throw new Error("No wrangler configuration file found.");
};