Skip to content

[Cloudflare] Environment & vite modes support #4300

@medz

Description

@medz

Describe the feature

Links:

For a long time, Nitro has not supported Cloudflare environments. However, deploying by environment or enabling development is a very common requirement.

We could customize the main module entry point after compilation, but this would break the nitro/vite dev command.

The Cloudflare vite plugin offers a solution: combining the vite name and the environments name and configuring it using CLOUDFLARE_ENV. This greatly simplifies the generated deploy config (.output/server/wrangler.json).


Alternative: For vite, you can use @cloudflare/vite-plugin as the dev server. This alternative will break nitro dev, which I personally do not recommend.

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions