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
7 changes: 0 additions & 7 deletions .changeset/browser-envname-fallback.md

This file was deleted.

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

## 0.5.1

### Patch Changes

- [#28](https://github.com/variableland/env/pull/28) [`8634e59`](https://github.com/variableland/env/commit/8634e597e332a798f752341d04745df74bc5a777) Thanks [@rqbazan](https://github.com/rqbazan)! - Clarify that the `envConfig()` Vite plugin is required for **any** non-development browser build, not just custom modes.

In the browser, `envName()`'s `readEnv()` only reads `window.__env` — never `process.env` — so a pure SPA can't see `NODE_ENV` / `VITE_ENV`. Without the plugin's `__ENV_NAME__` inject, `envName()` falls back to `"development"` (silently shipping the dev config to every environment), regardless of the `--mode` or `VITE_ENV` used at build time. The docs and the `__ENV_NAME__` JSDoc previously stated the browser would fall back to `"production"`, which is only true on the server.

## 0.5.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.5.0",
"version": "0.5.1",
"description": "Contract-first environment configuration with typed schemas",
"homepage": "https://github.com/variableland/env/tree/main/package#readme",
"bugs": {
Expand Down