# mrsteele/dotenv-webpack

A secure webpack plugin that supports dotenv and other environment variables and only exposes what you choose and use.

Repository: https://github.com/mrsteele/dotenv-webpack
Canonical: https://ross.abutalabs.com/products/dotenv-webpack
Language: JavaScript
License: MIT
License Family: permissive
Topics: webpack-plugin, dotenv-webpack, dotenv, webpack, plugin, secure, environment-variables
Last push: 2026-03-07T23:31:17+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 71, release rhythm 42, longevity 100
- inputs: {"age_days": 3683, "days_push": 179, "days_rel": 179, "gap_med": 254, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1295, forks 75 (observed 2026-08-28T04:04:16.403349+00:00)

## What it is
A webpack plugin that wraps dotenv and DefinePlugin to inject environment variables into your bundle at build time. It only exposes variables explicitly referenced in your code, keeping unreferenced secrets out of the final bundle.

## Use cases
- inject environment variables into a webpack bundle
- keep .env secrets out of client-side JavaScript
- replace process.env references at build time
- use dotenv with webpack without leaking unused variables
- manage per-environment config for a frontend build

## When to choose
- you build with webpack and want dotenv support
- you need selective exposure of env vars for security
- you want minimal configuration for env handling in bundles

## When to avoid
- you use Vite, esbuild, or another bundler with native env support
- you need runtime (server-side) environment variable loading rather than build-time replacement
- you need to expose all env vars to the bundle

## Facets
- artifact type: plugin
- maturity: active
- function: configuration-management, security, build-tool, plugin-system
- domain: web-development, frontend, developer-tools, security
- platform: -
- tags: webpack-plugin, dotenv, environment-variables, bundler, twelve-factor, nodejs, javascript

## Member repositories
- mrsteele/dotenv-webpack (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:16.403349+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:54:01.560654+00:00, confidence not recorded.
  - readme: https://github.com/mrsteele/dotenv-webpack (fetched 2026-08-28T04:04:16.403349+00:00, sha e96be372a3b6)
  - registry_npm: https://registry.npmjs.org/dotenv-webpack (fetched 2026-08-29T12:10:58.013777+00:00, sha 9d5cbddf088a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
