Skip to content

ArkEnv in vite.config.ts #365

@yamcodes

Description

@yamcodes

Problem

There’s no clear documentation on how to use ArkEnv for non-prefixed environment variables (e.g., PORT) in vite.config.ts. This leads to confusion and missed opportunities for type-safe config in server-side Vite code.

Context

Proposal

  • Recommend and document best practices for using ArkEnv inside vite.config.ts with unprefixed variables.
  • Implement any required additions, including potentially wrapping Vite's loadEnv with applied ArkEnv transformations and typing.
  • Add a clear example and update docs to clarify the distinction between server-only (config) and client-exposed (VITE_*) environment usage.
  • Optionally, add a sample or test to the examples folder.

Acceptance

  • ArkEnv-based parsing for unprefixed vars in vite.config.ts is implemented.
  • Docs clearly distinguish config/server-only and client env patterns.
  • Example usage is included.

Metadata

Metadata

Assignees

Labels

@arkenv/vite-pluginIssues or Pull Requests involving the Vite plugin for ArkEnvdocsImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions