examples/dotenv/template.md
This example demonstrates using the DotenvPlugin via the dotenv top-level configuration option.
The DotenvPlugin loads environment variables from .env files and exposes them in your application through process.env.
WEBPACK_ prefix${VAR_NAME} syntax${VAR:-default} for fallback valuesBy default, the plugin:
.env file from the project rootWEBPACK_ prefixprocess.env.WEBPACK_* with actual values at build timeEnvironment variables file (.env.local and .env.*.local are ignored by git):
_{{.env}}_
_{{example.js}}_
_{{webpack.config.js}}_
_{{dist/output.js}}_
_{{stdout}}_
_{{production:stdout}}_