Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .changeset/vite-env-var.md

This file was deleted.

20 changes: 20 additions & 0 deletions package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# @vlandoss/env

## 0.5.0

### Minor Changes

- [#26](https://github.com/variableland/env/pull/26) [`d355e6f`](https://github.com/variableland/env/commit/d355e6fc13765c12ae4cdf8b44b18b5ff1968684) Thanks [@rqbazan](https://github.com/rqbazan)! - The `envConfig()` Vite plugin can now select the env from a `VITE_ENV` env var instead of requiring `--mode`.

The plugin reads `VITE_ENV` from `process.env` **and** your `.env*` files (via Vite's `loadEnv`, so inline/shell values win over file values) and uses it to pick the per-env `#config` file and the `__ENV_NAME__` build constant. When `VITE_ENV` is unset or empty it falls back to Vite's `mode`, so `vite build --mode staging` keeps working unchanged — this is purely additive.

```bash
# These are now equivalent:
VITE_ENV=staging vite build
vite build --mode staging
```

The var name is configurable with the new `envVar` option (default `"VITE_ENV"`):

```ts
envConfig({ envVar: "APP_ENV" });
```

## 0.4.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vlandoss/env",
"version": "0.4.0",
"version": "0.5.0",
"description": "Contract-first environment configuration with typed schemas",
"homepage": "https://github.com/variableland/env/tree/main/package#readme",
"bugs": {
Expand Down