From 3e7ffc1f57d6142d3b7915c1fb8ee284ec82a300 Mon Sep 17 00:00:00 2001 From: James Opstad <13586373+jamesopstad@users.noreply.github.com> Date: Tue, 24 Nov 2026 17:42:01 +0000 Subject: [PATCH 1/2] fix: load .env files for the Build Output's mode when --mode is omitted --- .changeset/build-output-mode-dotenv.md | 9 ++ packages/cli/AGENTS.md | 6 + .../__tests__/commands/deploy/index.test.ts | 69 ++++++++++++ .../commands/previews-deploy.test.ts | 53 +++++++++ .../commands/triggers-deploy.test.ts | 105 ++++++++++++++++++ .../commands/versions-upload.test.ts | 52 +++++++++ packages/cli/src/commands/deploy/shared.ts | 18 +-- packages/cli/src/commands/previews/deploy.ts | 12 +- .../src/commands/workers/triggers/deploy.ts | 12 +- packages/cli/src/lib/build-output-dotenv.ts | 21 ++++ 10 files changed, 338 insertions(+), 19 deletions(-) create mode 100644 .changeset/build-output-mode-dotenv.md create mode 100644 packages/cli/src/lib/build-output-dotenv.ts diff --git a/.changeset/build-output-mode-dotenv.md b/.changeset/build-output-mode-dotenv.md new file mode 100644 index 0000000000..9a01f938da --- /dev/null +++ b/.changeset/build-output-mode-dotenv.md @@ -0,0 +1,9 @@ +--- +"cf": patch +--- + +Load `.env` files for the Build Output's mode when `--mode` is omitted + +`cf deploy`, `cf workers versions create`, `cf workers triggers deploy`, and `cf previews deploy` now load `.env.` and `.env..local` for the mode recorded in the Build Output when `--mode` is not passed. Previously they read only `.env` and `.env.local`, so deploying a staging build without repeating `--mode staging` could use the account and API token from `.env` instead of `.env.staging`. + +Vite records its default `production` mode when a build runs without `--mode`, so these commands now also load `.env.production` for such builds, matching the files the build itself used. An explicit `--mode` must still match the recorded mode. diff --git a/packages/cli/AGENTS.md b/packages/cli/AGENTS.md index 7cc598ec67..f9c22ed156 100644 --- a/packages/cli/AGENTS.md +++ b/packages/cli/AGENTS.md @@ -106,6 +106,12 @@ work. Its callback must finish, restoring the file values, before the child is started. Do not suppress normal inheritance of values that were already exported in the invoking environment. +Commands that consume Build Output load dotenv values with +`withBuildOutputDotEnv()` from `src/lib/build-output-dotenv.ts`. It reads the +output first and loads the files for the mode the output recorded, so deploys +read the same `.env.` files as the build. Callers must reject `--local` +and validate `--mode` against the recorded mode. + Tests for these commands must show both sides of the boundary: file values are available to the parent where required and sensitive file values are absent when the child process starts. Update the exclusion tests whenever a command diff --git a/packages/cli/src/__tests__/commands/deploy/index.test.ts b/packages/cli/src/__tests__/commands/deploy/index.test.ts index c0c8c096a3..7c0930df80 100644 --- a/packages/cli/src/__tests__/commands/deploy/index.test.ts +++ b/packages/cli/src/__tests__/commands/deploy/index.test.ts @@ -208,6 +208,75 @@ describe("cf deploy", () => { expect(process.env.CLOUDFLARE_ACCOUNT_ID).toBeUndefined(); }); + it.each([ + { + name: "prebuilt output when --mode is omitted", + flags: ["--prebuilt"], + recordedMode: "staging", + buildArgv: undefined, + }, + { + // Vite records its default "production" mode when --mode is omitted. + name: "a delegated build's default mode", + flags: [], + recordedMode: "production", + buildArgv: ["build"], + }, + ])( + "loads dotenv files for the recorded mode of $name", + async ({ flags, recordedMode, buildArgv }) => { + vi.stubEnv("CLOUDFLARE_API_TOKEN", undefined); + vi.stubEnv("CLOUDFLARE_ACCOUNT_ID", undefined); + let uploadRequest: + | { account: string | undefined; authorization: string | null } + | undefined; + mockWorkerUpload( + {}, + { + onRequest: (request) => { + uploadRequest = { + account: new URL(request.url).pathname.match( + /\/accounts\/([^/]+)\// + )?.[1], + authorization: request.headers.get("authorization"), + }; + }, + } + ); + await seed({ + ".env": [ + "CLOUDFLARE_API_TOKEN=default-token", + "CLOUDFLARE_ACCOUNT_ID=default-account", + ].join("\n"), + [`.env.${recordedMode}`]: [ + `CLOUDFLARE_API_TOKEN=${recordedMode}-token`, + `CLOUDFLARE_ACCOUNT_ID=${recordedMode}-account`, + ].join("\n"), + ".cloudflare/output/v1/config.json": buildOutputRootConfig({ + buildContext: { isPreview: false, mode: recordedMode }, + }), + ".cloudflare/output/v1/workers/default/worker.config.json": + workerConfig(), + ".cloudflare/output/v1/workers/default/bundle/index.js": + "export default { fetch() { return new Response('ok'); } }", + }); + + const { exitCode } = await runCf(["deploy", ...flags]); + + expect(exitCode).toBe(0); + if (buildArgv === undefined) { + expect(buildDelegateWasCalled()).toBe(false); + } else { + expect(readBuildDelegateArgv()).toEqual(buildArgv); + } + expect(uploadRequest).toEqual({ + account: `${recordedMode}-account`, + authorization: `Bearer ${recordedMode}-token`, + }); + expect(process.env.CLOUDFLARE_ACCOUNT_ID).toBeUndefined(); + } + ); + it("deploys a single ESM module", async () => { const upload = mockWorkerUpload(); await seed({ diff --git a/packages/cli/src/__tests__/commands/previews-deploy.test.ts b/packages/cli/src/__tests__/commands/previews-deploy.test.ts index 7e5de90b8b..f19c7b92c5 100644 --- a/packages/cli/src/__tests__/commands/previews-deploy.test.ts +++ b/packages/cli/src/__tests__/commands/previews-deploy.test.ts @@ -243,6 +243,59 @@ describe("cf previews deploy", () => { ); }); + describe("dotenv mode", () => { + runInTempDir(); + + it("loads dotenv files for the recorded mode when --prebuilt omits --mode", async () => { + vi.stubEnv("CLOUDFLARE_API_TOKEN", undefined); + vi.stubEnv("CLOUDFLARE_ACCOUNT_ID", undefined); + writeFileSync( + ".env", + "CLOUDFLARE_API_TOKEN=default-token\nCLOUDFLARE_ACCOUNT_ID=default-account\n" + ); + writeFileSync( + ".env.staging", + "CLOUDFLARE_API_TOKEN=staging-token\nCLOUDFLARE_ACCOUNT_ID=staging-account\n" + ); + mocks.readBuildOutput.mockResolvedValue({ + rootConfig: { buildContext: { isPreview: true, mode: "staging" } }, + workers: { + default: { + config: { type: "worker", name: "preview-worker" }, + bundleDir: "/project/bundle", + }, + }, + }); + mocks.assembleBuildResult.mockReturnValue({ content: "worker code" }); + mocks.getAuthToken.mockImplementation( + async () => process.env.CLOUDFLARE_API_TOKEN + ); + mocks.getAccountId.mockImplementation( + async () => process.env.CLOUDFLARE_ACCOUNT_ID + ); + mocks.createDeployContext.mockReturnValue({ + logger: { log: vi.fn(), info: vi.fn() }, + }); + mocks.previewBuildOutput.mockResolvedValue(previewResult); + + await expect( + runPreviewDeploy({ + "preview-name": "feature", + prebuilt: true, + } as Parameters[0]) + ).resolves.toBe(previewResult); + + expect(mocks.createDeployContext).toHaveBeenCalledWith("staging-token"); + expect(mocks.previewBuildOutput).toHaveBeenCalledWith( + "staging-account", + expect.any(Object), + expect.any(Object), + expect.any(Object) + ); + expect(process.env.CLOUDFLARE_ACCOUNT_ID).toBeUndefined(); + }); + }); + it("deploys the Preview under CLOUDFLARE_CI_OVERRIDE_WORKER_NAME", async () => { vi.stubEnv("CLOUDFLARE_CI_OVERRIDE_WORKER_NAME", "dashboard-worker"); const rootConfig = { buildContext: { isPreview: true } }; diff --git a/packages/cli/src/__tests__/commands/triggers-deploy.test.ts b/packages/cli/src/__tests__/commands/triggers-deploy.test.ts index 5ec12ab5b4..f7f2bf7525 100644 --- a/packages/cli/src/__tests__/commands/triggers-deploy.test.ts +++ b/packages/cli/src/__tests__/commands/triggers-deploy.test.ts @@ -189,6 +189,111 @@ describe("cf workers triggers deploy", () => { expect(process.env.CLOUDFLARE_ACCOUNT_ID).toBeUndefined(); }); + describe("dotenv mode", () => { + let schedulesRequest: + | { account: unknown; authorization: string | null } + | undefined; + + beforeEach(async () => { + vi.stubEnv("CLOUDFLARE_API_TOKEN", undefined); + vi.stubEnv("CLOUDFLARE_ACCOUNT_ID", undefined); + schedulesRequest = undefined; + msw.use( + http.put( + "*/accounts/:accountId/workers/scripts/:scriptName/schedules", + ({ request, params }) => { + schedulesRequest = { + account: params.accountId, + authorization: request.headers.get("authorization"), + }; + return HttpResponse.json(createFetchResult({ schedules: [] })); + } + ) + ); + await seed({ + ".env": [ + "CLOUDFLARE_API_TOKEN=default-token", + "CLOUDFLARE_ACCOUNT_ID=default-account", + ].join("\n"), + ".env.staging": [ + "CLOUDFLARE_API_TOKEN=staging-token", + "CLOUDFLARE_ACCOUNT_ID=staging-account", + ].join("\n"), + ".cloudflare/output/v1/workers/default/worker.config.json": + workerConfig({ + triggers: [{ type: "scheduled", schedule: "*/5 * * * *" }], + }), + ".cloudflare/output/v1/workers/default/bundle/index.js": + "export default { fetch() { return new Response('ok'); } }", + }); + }); + + it.each([ + { + name: "the recorded mode when --mode is omitted", + recordedMode: "staging", + flags: [], + expected: "staging", + }, + { + name: "an explicit --mode", + recordedMode: "staging", + flags: ["--mode", "staging"], + expected: "staging", + }, + { + name: "no mode when the Build Output records none", + recordedMode: undefined, + flags: [], + expected: "default", + }, + ])( + "loads prebuilt dotenv files for $name", + async ({ recordedMode, flags, expected }) => { + await seed({ + ".cloudflare/output/v1/config.json": buildOutputRootConfig({ + buildContext: { isPreview: false, mode: recordedMode }, + }), + }); + + const { exitCode } = await runCf([ + ...TRIGGERS_DEPLOY_COMMAND, + "--prebuilt", + ...flags, + ]); + + expect(exitCode).toBe(0); + expect(schedulesRequest).toEqual({ + account: `${expected}-account`, + authorization: `Bearer ${expected}-token`, + }); + expect(process.env.CLOUDFLARE_ACCOUNT_ID).toBeUndefined(); + } + ); + + it("loads dotenv files for the mode a delegated build recorded by default", async () => { + // Vite records its default "production" mode when --mode is omitted. + await seed({ + ".env.production": [ + "CLOUDFLARE_API_TOKEN=production-token", + "CLOUDFLARE_ACCOUNT_ID=production-account", + ].join("\n"), + ".cloudflare/output/v1/config.json": buildOutputRootConfig({ + buildContext: { isPreview: false, mode: "production" }, + }), + }); + + const { exitCode } = await runCf(TRIGGERS_DEPLOY_COMMAND); + + expect(exitCode).toBe(0); + expect(readBuildDelegateArgv()).toEqual(["build"]); + expect(schedulesRequest).toEqual({ + account: "production-account", + authorization: "Bearer production-token", + }); + }); + }); + it("skips the build and deploys existing triggers with --prebuilt", async () => { let schedulesBody: unknown; let schedulesAccount: unknown; diff --git a/packages/cli/src/__tests__/commands/versions-upload.test.ts b/packages/cli/src/__tests__/commands/versions-upload.test.ts index bc959632d4..6eaafd34f6 100644 --- a/packages/cli/src/__tests__/commands/versions-upload.test.ts +++ b/packages/cli/src/__tests__/commands/versions-upload.test.ts @@ -247,6 +247,58 @@ describe("cf workers versions create", () => { expect(upload.metadata?.main_module).toBe("index.js"); }); + it("loads dotenv files for the recorded mode when --prebuilt omits --mode", async () => { + vi.stubEnv("CLOUDFLARE_API_TOKEN", undefined); + vi.stubEnv("CLOUDFLARE_ACCOUNT_ID", undefined); + let uploadRequest: + | { account: string | undefined; authorization: string | null } + | undefined; + mockWorkerUpload( + {}, + { + onRequest: (request) => { + uploadRequest = { + account: new URL(request.url).pathname.match( + /\/accounts\/([^/]+)\// + )?.[1], + authorization: request.headers.get("authorization"), + }; + }, + } + ); + await seed({ + ".env": [ + "CLOUDFLARE_API_TOKEN=default-token", + "CLOUDFLARE_ACCOUNT_ID=default-account", + ].join("\n"), + ".env.staging": [ + "CLOUDFLARE_API_TOKEN=staging-token", + "CLOUDFLARE_ACCOUNT_ID=staging-account", + ].join("\n"), + ".cloudflare/output/v1/config.json": buildOutputRootConfig({ + buildContext: { isPreview: false, mode: "staging" }, + }), + ".cloudflare/output/v1/workers/default/worker.config.json": + workerConfig(), + ".cloudflare/output/v1/workers/default/bundle/index.js": + "export default { fetch() { return new Response('ok'); } }", + }); + + const { exitCode } = await runCf([ + "workers", + "versions", + "create", + "--prebuilt", + ]); + + expect(exitCode).toBe(0); + expect(uploadRequest).toEqual({ + account: "staging-account", + authorization: "Bearer staging-token", + }); + expect(process.env.CLOUDFLARE_ACCOUNT_ID).toBeUndefined(); + }); + it("points Preview Build Output to a mode-aware Preview deploy", async () => { const upload = mockWorkerUpload(); await seed({ diff --git a/packages/cli/src/commands/deploy/shared.ts b/packages/cli/src/commands/deploy/shared.ts index 818d66debc..0d0306a604 100644 --- a/packages/cli/src/commands/deploy/shared.ts +++ b/packages/cli/src/commands/deploy/shared.ts @@ -1,4 +1,3 @@ -import { readBuildOutput } from "@cloudflare/build-output-utils"; import { configureOpenAPIForContainerPull, initContainersSharedContext, @@ -13,6 +12,7 @@ import { getCloudflareComplianceRegion, } from "@cloudflare/workers-utils"; import { resolveBuildOutputAuth } from "../../lib/build-output-auth.js"; +import { withBuildOutputDotEnv } from "../../lib/build-output-dotenv.js"; import { applyCIMatchWorkerTag, applyCIWorkerNameOverride, @@ -30,12 +30,12 @@ import { createDeployProps, createVersionsUploadProps, } from "../../lib/deploy-input.js"; -import { withCloudflareDotEnv } from "../../lib/dotenv.js"; import { log } from "../../lib/ui/log.js"; import { runBuild } from "../build/index.js"; import { createContainerDeployConfig } from "./containers.js"; import { secretsFileDescription } from "./secrets-file-description.js"; import type { CommonYargsOptions, InferArgs } from "../../lib/cli-types.js"; +import type { BuildOutput } from "@cloudflare/build-output-utils"; import type { Argv } from "yargs"; /** @@ -108,14 +108,16 @@ export async function runUpload(argv: UploadArgs, ctx: UploadCommand) { log.message(""); } - return withCloudflareDotEnv(argv, () => uploadBuildOutput(argv, ctx)); + return withBuildOutputDotEnv((output) => + uploadBuildOutput(argv, ctx, output) + ); } -async function uploadBuildOutput(argv: UploadArgs, ctx: UploadCommand) { - // Parse the build output with cf's dotenv values available. - const { root, workers, rootConfig, containers } = await readBuildOutput( - process.cwd() - ); +async function uploadBuildOutput( + argv: UploadArgs, + ctx: UploadCommand, + { root, workers, rootConfig, containers }: BuildOutput +) { // --prebuilt can reuse files left behind by a Preview build. // Stop here so a production deploy cannot publish that Preview configuration. if (rootConfig.buildContext.isPreview) { diff --git a/packages/cli/src/commands/previews/deploy.ts b/packages/cli/src/commands/previews/deploy.ts index cd9028ea2a..fa4c6bed1b 100644 --- a/packages/cli/src/commands/previews/deploy.ts +++ b/packages/cli/src/commands/previews/deploy.ts @@ -1,4 +1,3 @@ -import { readBuildOutput } from "@cloudflare/build-output-utils"; import { ApplicationsService, configureOpenAPIForContainerPull, @@ -16,6 +15,7 @@ import { writeOutput, } from "@cloudflare/workers-utils"; import { resolveBuildOutputAuth } from "../../lib/build-output-auth.js"; +import { withBuildOutputDotEnv } from "../../lib/build-output-dotenv.js"; import { BuildOutputConfigError } from "../../lib/build-output-error.js"; import { applyCIWorkerNameOverride, @@ -27,7 +27,6 @@ import { } from "../../lib/build-output.js"; import { createDeployContext } from "../../lib/deploy-context.js"; import { assembleBuildResult } from "../../lib/deploy-input.js"; -import { withCloudflareDotEnv } from "../../lib/dotenv.js"; import { formatOutput } from "../../lib/output.js"; import { runBuild } from "../build/index.js"; import { @@ -41,6 +40,7 @@ import { } from "../deploy/static-assets.js"; import { createPreviewContainerCallbacks } from "./containers.js"; import type { CommonYargsOptions, InferArgs } from "../../lib/cli-types.js"; +import type { BuildOutput } from "@cloudflare/build-output-utils"; import type { PreviewResult } from "@cloudflare/deploy-helpers"; import type { Argv, CommandModule } from "yargs"; @@ -105,16 +105,16 @@ export async function runPreviewDeploy( ); } - return withCloudflareDotEnv(argv, () => - deployPreviewBuildOutput(argv, previewName) + return withBuildOutputDotEnv((output) => + deployPreviewBuildOutput(argv, previewName, output) ); } async function deployPreviewBuildOutput( argv: PreviewDeployArgs, - previewName: string + previewName: string, + output: BuildOutput ): Promise { - const output = await readBuildOutput(process.cwd()); assertPreviewBuildOutputRootConfig(output.rootConfig); validateBuildOutputMode(argv.mode, output.rootConfig.buildContext.mode); validateBuildOutputAccount( diff --git a/packages/cli/src/commands/workers/triggers/deploy.ts b/packages/cli/src/commands/workers/triggers/deploy.ts index 784669caea..eb2e8cdfcb 100644 --- a/packages/cli/src/commands/workers/triggers/deploy.ts +++ b/packages/cli/src/commands/workers/triggers/deploy.ts @@ -1,10 +1,10 @@ -import { readBuildOutput } from "@cloudflare/build-output-utils"; import { initDeployHelpersContext, triggersDeploy, } from "@cloudflare/deploy-helpers"; import { getCloudflareComplianceRegion } from "@cloudflare/workers-utils"; import { resolveBuildOutputAuth } from "../../../lib/build-output-auth.js"; +import { withBuildOutputDotEnv } from "../../../lib/build-output-dotenv.js"; import { applyCIWorkerNameOverride, buildOutputWorkerOption, @@ -15,10 +15,10 @@ import { } from "../../../lib/build-output.js"; import { createDeployContext } from "../../../lib/deploy-context.js"; import { createTriggerProps } from "../../../lib/deploy-input.js"; -import { withCloudflareDotEnv } from "../../../lib/dotenv.js"; import { log } from "../../../lib/ui/log.js"; import { runBuild } from "../../build/index.js"; import type { CommonYargsOptions, InferArgs } from "../../../lib/cli-types.js"; +import type { BuildOutput } from "@cloudflare/build-output-utils"; import type { Argv, CommandModule } from "yargs"; function builder(yargs: Argv) { @@ -68,12 +68,14 @@ const triggersDeployCommand: CommandModule< log.message(""); } - await withCloudflareDotEnv(argv, () => deployTriggers(argv)); + await withBuildOutputDotEnv((output) => deployTriggers(argv, output)); }, }; -async function deployTriggers(argv: TriggersDeployArgs): Promise { - const { workers, rootConfig } = await readBuildOutput(process.cwd()); +async function deployTriggers( + argv: TriggersDeployArgs, + { workers, rootConfig }: BuildOutput +): Promise { if (rootConfig.buildContext.isPreview) { const previewCommand = [ "cf previews deploy", diff --git a/packages/cli/src/lib/build-output-dotenv.ts b/packages/cli/src/lib/build-output-dotenv.ts new file mode 100644 index 0000000000..020829b14e --- /dev/null +++ b/packages/cli/src/lib/build-output-dotenv.ts @@ -0,0 +1,21 @@ +import { readBuildOutput } from "@cloudflare/build-output-utils"; +import { withCloudflareDotEnv } from "./dotenv.js"; +import type { BuildOutput } from "@cloudflare/build-output-utils"; + +/** + * Read the Build Output, then run a callback with cf's dotenv values for the + * mode it was built in, so deploys use the same `.env.` files as the + * build. `--mode` isn't consulted: callers reject one that differs from the + * recorded mode, and reject `--local`. + * + * Reading first is safe because `readBuildOutput` does not use `process.env`. + */ +export async function withBuildOutputDotEnv( + callback: (output: BuildOutput) => T | Promise +): Promise { + const output = await readBuildOutput(process.cwd()); + return withCloudflareDotEnv( + { mode: output.rootConfig.buildContext.mode }, + () => callback(output) + ); +} From 503deb5f55eea9ea60f08c0d29745bf06592106b Mon Sep 17 00:00:00 2001 From: James Opstad <13586373+jamesopstad@users.noreply.github.com> Date: Wed, 25 Nov 2026 08:27:09 +0000 Subject: [PATCH 2/2] PR feedback --- packages/cli/AGENTS.md | 4 ++-- packages/cli/src/__tests__/commands/deploy/index.test.ts | 9 ++++----- packages/cli/src/lib/build-output-dotenv.ts | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/cli/AGENTS.md b/packages/cli/AGENTS.md index f9c22ed156..f089de63cd 100644 --- a/packages/cli/AGENTS.md +++ b/packages/cli/AGENTS.md @@ -109,8 +109,8 @@ exported in the invoking environment. Commands that consume Build Output load dotenv values with `withBuildOutputDotEnv()` from `src/lib/build-output-dotenv.ts`. It reads the output first and loads the files for the mode the output recorded, so deploys -read the same `.env.` files as the build. Callers must reject `--local` -and validate `--mode` against the recorded mode. +read the same `.env.` files as the build. Callers must reject the +`--local` flag and validate `--mode` against the recorded mode. Tests for these commands must show both sides of the boundary: file values are available to the parent where required and sensitive file values are absent diff --git a/packages/cli/src/__tests__/commands/deploy/index.test.ts b/packages/cli/src/__tests__/commands/deploy/index.test.ts index 7c0930df80..352fd0e955 100644 --- a/packages/cli/src/__tests__/commands/deploy/index.test.ts +++ b/packages/cli/src/__tests__/commands/deploy/index.test.ts @@ -248,10 +248,9 @@ describe("cf deploy", () => { "CLOUDFLARE_API_TOKEN=default-token", "CLOUDFLARE_ACCOUNT_ID=default-account", ].join("\n"), - [`.env.${recordedMode}`]: [ - `CLOUDFLARE_API_TOKEN=${recordedMode}-token`, - `CLOUDFLARE_ACCOUNT_ID=${recordedMode}-account`, - ].join("\n"), + // The token is only in .env, so it must be merged with the + // mode file rather than replaced by it. + [`.env.${recordedMode}`]: `CLOUDFLARE_ACCOUNT_ID=${recordedMode}-account`, ".cloudflare/output/v1/config.json": buildOutputRootConfig({ buildContext: { isPreview: false, mode: recordedMode }, }), @@ -271,7 +270,7 @@ describe("cf deploy", () => { } expect(uploadRequest).toEqual({ account: `${recordedMode}-account`, - authorization: `Bearer ${recordedMode}-token`, + authorization: "Bearer default-token", }); expect(process.env.CLOUDFLARE_ACCOUNT_ID).toBeUndefined(); } diff --git a/packages/cli/src/lib/build-output-dotenv.ts b/packages/cli/src/lib/build-output-dotenv.ts index 020829b14e..3365032a83 100644 --- a/packages/cli/src/lib/build-output-dotenv.ts +++ b/packages/cli/src/lib/build-output-dotenv.ts @@ -6,7 +6,7 @@ import type { BuildOutput } from "@cloudflare/build-output-utils"; * Read the Build Output, then run a callback with cf's dotenv values for the * mode it was built in, so deploys use the same `.env.` files as the * build. `--mode` isn't consulted: callers reject one that differs from the - * recorded mode, and reject `--local`. + * recorded mode, and reject the `--local` flag. * * Reading first is safe because `readBuildOutput` does not use `process.env`. */