{
  "slug": "workers-static-assets-supports-a-url-base-path-33774ccb6607",
  "title": "Workers Static Assets supports a URL base path",
  "tools": [
    "cf"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-28T00:00:00.000Z",
  "announced_at": "2026-10-28T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When static assets must be served under a URL prefix without changing their directory structure, set `assets.base_path` in Wrangler or `worker.assets.basePath` in `cloudflare.config.ts`. Use Wrangler 4.148.0 or later, or cf 1.0.0-beta.13 or later for `cloudflare.config.ts`.",
    "examples": [
      "{\"$schema\":\"./node_modules/wrangler/config-schema.json\",\"assets\":{\"directory\":\"./dist\",\"base_path\":\"/blog\"}}",
      "[assets]\ndirectory = \"./dist\"\nbase_path = \"/blog\"",
      "import { defineConfig } from \"cf/config\";\n\nexport default defineConfig({\n  worker: {\n    name: \"blog\",\n    compatibilityDate: \"2026-10-28\",\n    assets: { basePath: \"/blog\" },\n  },\n});"
    ],
    "gotchas": [
      "Version: Wrangler 4.148.0 or later; cf 1.0.0-beta.13 or later with cloudflare.config.ts",
      "assets.base_path / worker.assets.basePath (required): URL path prefix for served assets.",
      "assets.directory: Wrangler assets directory; optional when the Cloudflare Vite plugin supplies build output.",
      "Prerequisite: Wrangler 4.148.0 or later; for `cloudflare.config.ts`, cf 1.0.0-beta.13 or later.",
      "The base path applies to the URL path; asset directory structure does not change.",
      "Wrangler uses `assets.directory` to select the served directory. With `cloudflare.config.ts`, the build configuration supplies the assets."
    ]
  },
  "why_it_matters": "Serve a repository’s built static assets under a URL prefix while keeping their directory structure unchanged.",
  "sources": [
    "https://developers.cloudflare.com/changelog/post/2026-10-28-static-assets-base-path/",
    "https://developers.cloudflare.com/workers/wrangler/configuration/"
  ],
  "rank": 0.9703,
  "review_state": "approved",
  "provenance": {
    "run_id": "daily-20261028-20",
    "verdict_id": "daily-20261028-20:daily-20261028-20-656dfb7daa1e9848-0:gate",
    "evidence_hash": "055335dd43468db430d25f7717a7a944a38af9b5e7072ccdc4d75db0d0075d0e"
  }
}
