v0.4.0
Framework compatibility fixes for Nuxt and VitePress, plus a change to how nub selects .env files.
Important
NODE_ENV no longer selects .env files. nub now treats NODE_ENV as the application's own dev/prod variable — it never sets it, never reads it to pick env files, and won't let a .env file change it. Env-file mode is now driven by APP_ENV. To migrate an ambient NODE_ENV=<mode> that was selecting .env.{mode} files, set APP_ENV=<mode> instead. This matches how Vite, varlock, dotenvx, Node, and Deno decoupled env-file mode from NODE_ENV.
Framework compatibility
| Framework | What changed | PR |
|---|---|---|
| Nuxt 4 | Optional peers that are present and range-satisfying are now hoisted into ejected closure members under the global virtual store, so nuxt prepare/nuxt dev resolve @vue/compiler-sfc (statically imported by vue-router's /vite entry). |
#350 |
| VitePress | The store directory is now appended to Vite's server.fs.allow instead of being skipped when the list is already set, so VitePress can read linked files from the store. |
#346 |
Env-file mode
.env.{mode} selection is driven by APP_ENV. With it unset, only .env.local and .env load. The mode value is restricted to [A-Za-z0-9_.-], and --env-file (repeatable) still loads specific files explicitly. (#351)
Install
--lockfile-only is now exempt from the CI auto-frozen-lockfile default, so nub install --lockfile-only updates the lockfile in CI instead of failing as frozen. (#349)
What's Changed
- fix(pm): append store dir to Vite fs.allow instead of skip-if-set (VitePress) by @colinhacks in #346
- fix(install): exempt --lockfile-only from the CI auto-frozen default by @colinhacks in #349
- fix(pm): hoist satisfied optional peers into ejected closure members (GVS) by @colinhacks in #350
- feat(env): select .env mode from --env > APP_ENV, drop NODE_ENV (breaking) by @colinhacks in #351
Full Changelog: v0.3.1...v0.4.0