Minor Changes
-
#13985
c809d30Thanks @jamesopstad! - AddassetsOnly(entry Worker) anddevOnly(auxiliary Workers) options to the plugin configBoth options accept a
booleanor a function that returns aboolean. The function is evaluated lazily at build time, allowing frameworks to provide the value after initialization.Use
assetsOnlyon the entry Worker to skip building the Worker and instead emit an assets-only Wrangler config to the client output directory. This enables frameworks such as Astro to use thessrenvironment during development but produce a fully static app for deployment.export default defineConfig({ plugins: [ cloudflare({ assetsOnly: () => isStaticBuild, }), ], });
Use
devOnlyon an auxiliary Worker to include it duringvite devbut skip it at build time.export default defineConfig({ plugins: [ cloudflare({ auxiliaryWorkers: [ { configPath: "./dev-only-worker/wrangler.jsonc", devOnly: true }, ], }), ], });