Skip to content

Avoid exposing internal Vite+ env vars via Vite env prefix #1074

@crusty-voidzero

Description

@crusty-voidzero

Summary

After migrating Rolldown's CI to Vite+, tests started failing because Vite+ injects VITE_PLUS_* environment variables.

These variables may be picked up by Vite's env exposure logic because they start with VITE_:

This means they can end up included in bundled applications unexpectedly.

Repro / context

Problem

Even if the current vars do not contain sensitive information, using the VITE_ prefix creates unnecessary risk and surprising behavior.

Suggested fix

Rename internal env vars to something that does not match Vite's default public env prefix, e.g.

  • VITEPLUS_*
  • or another non-VITE_ prefix

Expected outcome

Internal Vite+ env vars should not be accidentally exposed to application bundles via Vite's envPrefix behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Priority

    Medium

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions