c12 is a smart configuration loader for JavaScript and TypeScript projects. It can load and merge config files across many formats (JSON, YAML, TOML, and others), supports environment-specific overrides and `.env` variable interpolation, and offers features like config watching with auto-reload and HMR.
Project status
- The source (unjs/c12) appears actively maintained, with an upstream push on 2026-06-10 and recent package updates through 2026-05-06.
- Update cadence looks fairly frequent for the period shown, roughly every 2 to 7 weeks across the v4.0.0-beta.* line (Feb 6, Feb 17, Mar 15, Apr 1, May 6), suggesting an evolving roadmap rather than a long pause.
AI summary generated
Recent updates
v4.0.0-beta.5
Release v4.0.0-beta.5 claims only one enhancement, adding support for `jitiOptions` (plus related tests and a small documentation update). However, the provided code diff (from an earlier v3.x baseline) contains several larger behavioral and API surface changes, especially around config module loading and dotenv handling, that are not mentioned in the beta.5 release notes.
Featuresv3.3.4
v3.3.4 mainly updates dependencies and tweaks the package build/package metadata. It also simplifies the package.json exports field and bumps giget to v3. The code changes include additional build-script adjustments and, importantly, a subtle change to how TypeScript types are exposed for subpath exports.
v4.0.0-beta.4
v4.0.0-beta.4 makes loader behavior more correct and more predictable by (1) busting the ESM import cache for native JS config modules and (2) properly detecting directories whose names contain dots. The changes are implemented in src/loader.ts and are reinforced with new loader tests and fixture coverage.
Breakingv4.0.0-beta.3
v4.0.0-beta.3 changes how c12 handles `.env` `_FILE` secret references by making `expandFileReferences` opt-in. The release also updates documentation and refreshes some dev tooling and dependencies (including `dotenv`).
Breakingv4.0.0-beta.2
v4.0.0-beta.2 focuses on performance and environment handling improvements, including faster TypeScript loading and native .env parsing. It also adds support for resolving environment variables via _FILE references and moves giget/dotenv/chokidar related behavior toward optional peer dependencies for smaller installs and better runtime compatibility.
Featuresv4.0.0-beta.1
v4.0.0-beta.1 introduces a loader change where configuration imports now use native import by default, with jiti becoming optional rather than a hard dependency. It also updates the public `loadConfig` option types (replacing `jiti`/`jitiOptions` with `import` and `resolveModule`) and makes `chokidar` optional for watching.
Featuresv3.3.3
v3.3.3 primarily upgrades the file-watching dependency chokidar to the 5.x line. The release notes mention this explicitly, but the actual diff shows additional CI workflow and toolchain dependency updates not covered in the notes.
Breakingv3.3.2
v3.3.2 mostly changes build tooling and dependency constraints. Release notes mention a documentation typo fix (globalRc) and the move to obuild (rolldown) plus a relaxation of the magicast peer dependency range.
v3.3.1
v3.3.1 focuses on config resolution behavior around extensions, specifically tightening how “extends” targets are resolved. The diff also includes a loader resolution fallback removal, several dependency bumps, and test/fixture updates to reflect the stricter extension handling.
Breakingv3.3.0
Release v3.3.0 adds enhancements for configuration loading, including support for config files whose default export is an array. It also improves dotenv handling by making `cwd` optional, defaulting to the process working directory when omitted.
Features