{
  "slug": "wrangler-experimental-typescript-config-via-x-new-config-87655c7b9a16",
  "title": "wrangler experimental TypeScript config via --x-new-config",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-11T15:34:04.000Z",
  "announced_at": "2026-06-11T15:34:04.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When authoring a Worker config in TypeScript, add the required `cloudflare.config.ts` using `defineWorker` from `wrangler/experimental-config`, then run a supported Wrangler command with `--x-new-config`. Optionally add `wrangler.config.ts` using `defineWranglerConfig`; branch on `ctx.mode` in either file’s function form for per-environment settings.",
    "examples": [
      "wrangler dev --x-new-config",
      "wrangler build --x-new-config",
      "import { defineWorker, bindings } from \"wrangler/experimental-config\";\nimport * as entrypoint from \"./src/index.ts\" with { type: \"cf-worker\" };\n\nexport default defineWorker((ctx) => ({\n  name: \"<worker-name>\",\n  entrypoint,\n  compatibilityDate: \"<YYYY-MM-DD>\",\n  env: {\n    MY_KV: bindings.kv(),\n    MY_TEXT: bindings.text(`The mode is ${ctx.mode}`),\n  },\n}));"
    ],
    "gotchas": [
      "Version: 4.100.0",
      "Availability: Experimental, opt-in; the flag, config formats, and `wrangler/experimental-config` exports may change in any release.",
      "--x-new-config (required): Opt into loading Worker configuration from `cloudflare.config.ts` for the supported commands.",
      "cloudflare.config.ts (required): Worker runtime configuration, authored with `defineWorker` from `wrangler/experimental-config`.",
      "wrangler.config.ts: Wrangler-specific development/build configuration, authored with `defineWranglerConfig` from `wrangler/experimental-config`.",
      "ctx.mode: Use within the function form of either config file to branch configuration by environment mode.",
      "Prerequisite: Wrangler 4.100.0 introduced the experimental opt-in; flag and config exports may change in any release.",
      "Prerequisite: Provide `cloudflare.config.ts`; `wrangler.config.ts` is optional.",
      "`cloudflare.config.ts` is required.",
      "`wrangler.config.ts` is optional.",
      "Per-environment configuration uses `ctx.mode` branching inside the function form of either file."
    ]
  },
  "why_it_matters": "When authoring a Worker configuration in TypeScript, run Wrangler commands using the experimental config files.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.100.0"
  ],
  "rank": 0.95037,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-c1933e94ed950cd5-1:gate",
    "evidence_hash": "5127e3fa7f5c5d9ac5e1842b56177b80666843ad9fbf29243b9a51a855738bab"
  },
  "review": {
    "draft_hash": "07520a7965d674fe951cf30bc91829bdb4673fd332552106fb031c0f0339b1d2",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.67 (>= 0.6 needed)."
  }
}
