Serve a Worker's static assets from a URL path like /blog/
changelog / Compute / Workers, Cloudflare CLI / 2026/11/11 09:00 JST
Workerの静的アセットを /blog/ のようなURLパス配下で配信可能に。ビルド出力を入れ子にしなくても、wrangler設定の assets.base_path (cloudflare.config.tsでは worker.assets.basePath) を指定するだけでよい。
You can now serve your Worker’s static assets from a URL path prefix, such as example.com/blog/ , without changing your build output. Previously, to serve assets from /blog/ , you had to nest your files in a matching blog directory. Now, set assets.base_path in your Wrangler configuration file, or worker.assets.basePath in cloudflare.config.ts , and keep your files at the root of your asset directory. Use Wrangler 4.148.0 ↗︎ or later. With cloudflare.config.ts , use cf 1.0.0-beta.13 ↗︎ or later. For example, this configuration serves your built assets from /blog/ : The following content appear
出典: 公式ページ