Skip to content

Allow specifying a different file to save CONVEX_DEPLOYMENT and VITE_CONVEX_URL to #206

@thomasballinger

Description

@thomasballinger

from #193 (comment)

maybe npx convex dev --env-file ../../.env should cause VITE_CONVEX_URL / NEXT_PUBLIC_CONVEX_URL / CONVEX_URL to be written to that file as well.

That's not what --env-file does today, so we need to make sure this makes sense / is backward compatible with this flag. Today this file is only used to read CONVEX_DEPLOYMENT or CONVEX_SELF_HOSTED_URL.

We could separate reading CONVEX_DEPLOYMENT / CONVEX_SELF_HOSTED_URL out (--env-file today) from writing VITE_CONVEX_URL (no option today, could be called --client-url-env-file). They're fundamentally two different things: VITE_CONVEX_URL is about publishing the location of the deployment to the client. CONVEX_DEPLOYMENT / CONVEX_SELF_HOSTED_URL are about telling the CLI which deployment to dev against / deploy to.

Note that {NEXT_PUBLIC_,VITE_,}CONVEX_URL will likely be joined by {NEXT_PUBLIC_,VITE_}CONVEX_SITE_URL soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions