Repository navigation
Support Cloudflare's cf CLI config (cloudflare.config.ts) in @flue/vite #945
greghunt
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Let
@flue/vitelayer its Worker entry and Durable Object bindings onto a project configured with Cloudflare'scfCLI (cloudflare.config.ts/cf/config), not only onto a Wrangler config.Background & Motivation
Cloudflare's
cfCLI configures a Worker incloudflare.config.ts(defineConfig,bindings,exportsfromcf/config), which@cloudflare/vite-plugin2.x reads.flueWorkerConfig()only customizes a Wrangler-shaped config object, so in acfproject it cannot add Flue's generated entry (virtual:flue/worker) or the Durable Object bindings and classes for each agent.To use Flue in a
cfproject today we:cloudflare.config.ts,worker.entrypointto Flue's generated entry by hand,flue()andcloudflare()that runsflueWorkerConfig()against a scratch Wrangler-shaped object. That satisfiesflue()'s "customizer applied" check and its compatibility-date floor, and fails the build when Flue derives a binding or class the config does not declare,It works, but every new agent means a manual config edit, and the plugin depends on how
flue()detects the customizer.Goals
cfproject gets Flue's entry and per-agent Durable Object bindings and exports without declaring them by hand.flue()stops requiring a Wrangler customizer when the project is configured withcloudflare.config.ts.cloudflare.config.ts.Example
All reactions