Skip to content
JS
Alternatives

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.

Data as of 25 Sept 2026
PackageWeekly downloads12-month changeGzipDependenciesLast releaseModuleTypesRuntimes
dotenv-webpack
This package
929.6k-8%-16 months agoCommonJSBundled-
rollup-plugin-dotenv10.7k+39%-22 years agoESM + CommonJSBundled-
ts-dotenv23.2k+215%-03 years agoCommonJSBundled-
esbuild-envfile-plugin14.6k+80%-12 years agoCommonJSNone-
dotenv-flow799.1k+89%-12 years agoCommonJSBundled-
dotenv130.9m+122%-02 days agoCommonJSBundled-
@dotenvx/dotenvx8.8m+1056%-62 days agoCommonJSBundled-
cypress-dotenv47.2k-8%-31 year agoCommonJSNone-
@import-meta-env/unplugin24.9k--51 year agoCommonJSBundled-

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)
Sources: npm registry, npm downloads API, GitHub API, Bundlephobia. Data fetched 25 Sept 2026.

Indexability: Indexed.