dotenv-webpack alternatives
8 packages that do the same job as dotenv-webpack: rollup-plugin-dotenv, ts-dotenv, esbuild-envfile-plugin, dotenv-flow, dotenv, @dotenvx/dotenvx, cypress-dotenv, @import-meta-env/unplugin. Figures below are from npm, GitHub and Bundlephobia.
| Package | Weekly downloads | 12-month change | Gzip | Dependencies | Last release | Module | Types | Runtimes |
|---|---|---|---|---|---|---|---|---|
| dotenv-webpack This package | 929.6k | -8% | - | 1 | 6 months ago | CommonJS | Bundled | - |
| rollup-plugin-dotenv | 10.7k | +39% | - | 2 | 2 years ago | ESM + CommonJS | Bundled | - |
| ts-dotenv | 23.2k | +215% | - | 0 | 3 years ago | CommonJS | Bundled | - |
| esbuild-envfile-plugin | 14.6k | +80% | - | 1 | 2 years ago | CommonJS | None | - |
| dotenv-flow | 799.1k | +89% | - | 1 | 2 years ago | CommonJS | Bundled | - |
| dotenv | 130.9m | +122% | - | 0 | 2 days ago | CommonJS | Bundled | - |
| @dotenvx/dotenvx | 8.8m | +1056% | - | 6 | 2 days ago | CommonJS | Bundled | - |
| cypress-dotenv | 47.2k | -8% | - | 3 | 1 year ago | CommonJS | None | - |
| @import-meta-env/unplugin | 24.9k | - | - | 5 | 1 year ago | CommonJS | Bundled | - |
12-month change compares the average of the last 4 weeks of downloads with the first 4 weeks of the 52-week series. Gzip size is for the whole package (Bundlephobia). Runtimes are taken from each package's own documentation; "-" means not recorded.
Rollup plugin that loads available .env files and replaces the defined variables with their values
Compared with dotenv-webpack
- 87x fewer weekly downloads (10.7k vs 929.6k)
- 2 dependencies vs 1
- ESM + CommonJS vs CommonJS
- Declares Node.js >=14 vs Node.js >=18.18.0
- Last release 15 Apr 2024 vs 7 Mar 2026
- 39x fewer GitHub stars (33 vs 1.3k)
Strongly-typed environment variables from .env & process.env
Compared with dotenv-webpack
- 40x fewer weekly downloads (23.2k vs 929.6k)
- 0 dependencies vs 1
- Declares no Node.js engine range vs Node.js >=18.18.0
- Last release 5 Feb 2023 vs 7 Mar 2026
- 29x fewer GitHub stars (44 vs 1.3k)
esbuild plugin to load a .env file from the current directory or any parent. It will combine the environment variables with existing/system-wide process.env variables.
Compared with dotenv-webpack
- 64x fewer weekly downloads (14.6k vs 929.6k)
- No types vs bundled types
- Declares no Node.js engine range vs Node.js >=18.18.0
- Last release 8 May 2024 vs 7 Mar 2026
- 93x fewer GitHub stars (14 vs 1.3k)
Loads environment variables from `.env.[development|test|production][.local]` files
Compared with dotenv-webpack
- 1.2x fewer weekly downloads (799.1k vs 929.6k)
- Declares Node.js >= 12.0.0 vs Node.js >=18.18.0
- Last release 26 Dec 2023 vs 7 Mar 2026
- 1.4x fewer GitHub stars (902 vs 1.3k)
Loads environment variables from .env file
Compared with dotenv-webpack
- 141x more weekly downloads (130.9m vs 929.6k)
- 0 dependencies vs 1
- Declares Node.js >=12 vs Node.js >=18.18.0
- Last release 22 Sept 2026 vs 7 Mar 2026
- 16x more GitHub stars (20.5k vs 1.3k)
a secure dotenv–from the creator of `dotenv`
Compared with dotenv-webpack
- 9.5x more weekly downloads (8.8m vs 929.6k)
- 6 dependencies vs 1
- Declares no Node.js engine range vs Node.js >=18.18.0
- Last release 22 Sept 2026 vs 7 Mar 2026
- 4.5x more GitHub stars (5.8k vs 1.3k)
Cypress plugin that enables compatibility with dotenv
Compared with dotenv-webpack
- 20x fewer weekly downloads (47.2k vs 929.6k)
- 3 dependencies vs 1
- No types vs bundled types
- Declares Node.js >=18.17.0 vs Node.js >=18.18.0
- Last release 30 Dec 2024 vs 7 Mar 2026
- 24x fewer GitHub stars (55 vs 1.3k)
Build once, deploy anywhere. Startup/runtime environment variable solution for JavaScript.
Compared with dotenv-webpack
- 37x fewer weekly downloads (24.9k vs 929.6k)
- 5 dependencies vs 1
- Declares no Node.js engine range vs Node.js >=18.18.0
- Last release 22 Sept 2025 vs 7 Mar 2026
- 4.7x fewer GitHub stars (276 vs 1.3k)
Indexability: Indexed.