Skip to content

Commit

Permalink
refactor(cloudflare-pages): update root wrangler.toml in CI (#2355)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Apr 10, 2024
1 parent f75f042 commit 8e88dd4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/presets/cloudflare-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { defineNitroPreset } from "../preset";
import type { Nitro } from "../types";
import { CloudflarePagesRoutes } from "../types/presets/cloudflare";
import defu from "defu";
import { isCI } from "std-env";

export const cloudflarePages = defineNitroPreset({
extends: "cloudflare",
Expand Down Expand Up @@ -237,6 +238,10 @@ async function writeCFWrangler(nitro: Nitro) {

const wranglerConfig: WranglerConfig = defu(configFromFile, inlineConfig);

const wranglerPath = join(nitro.options.output.publicDir, "wrangler.toml");
const wranglerPath = join(
isCI ? nitro.options.rootDir : nitro.options.buildDir,
"wrangler.toml"
);

await fsp.writeFile(wranglerPath, stringifyTOML(wranglerConfig));
}

0 comments on commit 8e88dd4

Please sign in to comment.