-
Notifications
You must be signed in to change notification settings - Fork 179
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
docs: add cloudflare workers section #1808
base: main
Are you sure you want to change the base?
Conversation
Cloudflare Workers is going to be in the future the main way to deploy application on Cloudflare, presenting it first makes sense. This also includes some re-organizing of the cloudflare pages section.
Co-authored-by: Pooya Parsa <[email protected]>
The current config and docs are valid 💯 Thinking would be better advise new users to use the new managed export default defineNuxtConfig({
compatibilityDate: "2025-03-01",
nitro: { cloudflare: { nodeCompat: true, deployConfig: true } }
}); It generates all proper config (including compat flags and asset binding with valid path). Cloudflare starter template for Nuxt already updated with this and Nitro docs should be updated as well. |
I don't mind making the change, but what is the behaviour of this flag ? Should we meet in the middle and recommend in this docs using deployConfig as an alternative to the user controlled wrangler.jsonc ? There's a subset of user that definitely prefer avoiding the abstractions. |
Yes, it will be merged if the user config exists. We had been working with the cloudflare team for months to achieve this functionality (that is the default for the ongoing vite plugin and new nitro) -- it is only not enabled today because cloudflare needs safer migration for existing deployments. |
@pi0 got it, I made changes to recommend the use of these flags and provided more context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments from the Cloudflare side, thanks so much for putting up this PR 🧡
} | ||
} | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a local dev step?
- Develop your project locally:
npx nuxi dev
nitro-cloudflare-dev provides access to local simulators of Cloudflare bindings. It is currently experimental.
We would need to add modules: ["nitro-cloudflare-dev"]
to the nuxt config above as well.
Or we could add a preview step after build that just runs npx wrangler dev
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion, I've added that as a tip.
@pi0 it's not available through nuxi add module
due to being experimental? Because this would be a really smooth way to add the module.
Co-authored-by: emily-shen <[email protected]>
Co-authored-by: emily-shen <[email protected]>
Co-authored-by: emily-shen <[email protected]>
Cloudflare Workers is going to be in the future the main way to deploy application on Cloudflare, presenting it first makes sense. This also includes some re-organizing of the cloudflare pages section.
🔗 Linked issue
❓ Type of change
📚 Description