-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cloudflare): generated wrangler configuration #2949
Conversation
Given this is using the cloudflare_pages plugin, this should not have an This is likely to break the Pages CI. Not a problem in real life because the user wouldn't have that. But in terms of testing, I will remove that from the wrangler.toml |
For Pages projects that have a Depending on what you want the DX, you could either require the user to add that field themselves, or you could add it as part of the generation of |
Nitro has introduced an experimental (opt-in) way to generate/extend
wrangler.toml
for cloudflare deployments (#2353, #2355) (However, overwriting the user config is not ideal or recommended, so it remain experimental)The end goal is to leverage Cloudflare platform features such as Node compat v2 (hybrid) and Async Context with zero-config and ensure we can reliably enable these features.
Thanks to the huge huge efforts and collab with the Cloudflare team and @petebacondarwin, a new solution (~> cloudflare/workers-sdk#7442) is coming to allow frameworks like Nitro to generate a merged
wrangler.toml
in dist and config that redirects/points wrangler CLI and pages CI to it.Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#generated-wrangler-configuration
Remarks
cloudflare.noWranglerDeployConfig: true
can be used to opt-out from generating deploy-config in.wrangler/deploy/config.json
wrangler.toml|json
is read and always merged with the highest precedencecloudflare.wrangler
objectcompatibility_date
defaults tocompatibilityDate
from framework configcompatibility_flags
defaults to["nodejs_compat", "no_nodejs_compat_v2"]
Pages
pnpm nitro build playground --preset cloudflare_pages
dist/_worker.js/wrangler.json
:Modules
pnpm nitro build playground --preset cloudflare_module
.output/server/wrangler.json
: