@dotenv-run/webpack

Run webpack scripts with environment variables from .env files

npmmacoslinuxwindows
Try with needOr install directly
Source

About

Run your scripts with dotenv variables

Commands

dotenv-run

Examples

build webpack project with environment variables loaded$ dotenv-run webpack
run webpack dev server with dotenv variables$ dotenv-run webpack serve
use specific env file for webpack build$ dotenv-run -f .env.production webpack build
load multiple env files before running webpack$ dotenv-run -f .env -f .env.local webpack
run webpack with custom node environment variable$ dotenv-run NODE_ENV=production webpack --mode production