A collection of packages to load environment variables from .env files with support for CLI, bundlers, monorepos, and TypeScript.
dotenv-run is a versatile toolset for managing environment variables across JavaScript and TypeScript projects. It extends the functionality of dotenv with specialized integrations for popular build tools and frameworks, ensuring consistent environment variable loading in development and production. It solves the problem of handling environment variables in complex project structures like monorepos and across different bundlers.
JavaScript and TypeScript developers working in monorepos or using multiple build tools like Webpack, Vite, Rollup, ESBuild, or Angular. It is particularly useful for teams needing a unified, secure approach to environment variable management across diverse applications and libraries.
Developers choose dotenv-run over basic dotenv for its extensive integration support and monorepo capabilities. Its unique selling point is providing a single, consistent toolset with plugins for nearly every major JavaScript bundler and framework, along with TypeScript definitions and secure variable filtering.
Seamlessly load environment variables. Supports cli, esbuild, rollup, vite, webpack, angular, ESM and Monorepos.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Explicitly supports loading environment variables from nested directories in monorepos, as shown in the example with root directory traversal and priority-based file loading.
Provides dedicated plugins for CLI, Webpack, Rollup, Vite, ESBuild, Angular, and Rspack, ensuring compatibility across most modern JavaScript ecosystems.
Includes type definitions for both process.env and import.meta.env, offering full TypeScript support and seamless integration with ECMAScript modules.
Allows prefix-based filtering to expose only selected environment variables, preventing accidental leakage of sensitive data in client-side code, as highlighted in the configuration options.
Requires managing multiple options like root, prefix, files, and environment, which can be verbose and error-prone compared to simpler, single-purpose libraries.
Being a collection of packages means installing and configuring separate integrations for each build tool, increasing dependency management overhead and potential bundle bloat.
The Angular builder defaults to the NG_APP_ prefix, which may not align with existing project conventions, forcing additional configuration or refactoring.