All Projects → nwinch → webpack-dotenv-plugin

nwinch / webpack-dotenv-plugin

Licence: MIT license
Use dotenv with webpack.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webpack-dotenv-plugin

ini
📝 Go INI config management. support multi file load, data override merge. parse ENV variable, parse variable reference. Dotenv file parse and loader. INI配置读取管理,支持多文件加载,数据覆盖合并, 解析ENV变量, 解析变量引用。DotEnv 解析加载
Stars: ✭ 72 (+35.85%)
Mutual labels:  dotenv, environment-variables, env
ts-dotenv
Strongly-typed environment variables for Node.js
Stars: ✭ 18 (-66.04%)
Mutual labels:  dotenv, environment-variables, env
php-env
A small and fast .env loader for PHP
Stars: ✭ 19 (-64.15%)
Mutual labels:  dotenv, environment-variables, env
envfile
Parse and write environment files with Node.js
Stars: ✭ 42 (-20.75%)
Mutual labels:  dotenv, environment-variables, env
checkdotenv
Verify environment variables presence for Node JS.
Stars: ✭ 12 (-77.36%)
Mutual labels:  dotenv, environment-variables, env
exenv
Exenv makes loading environment variables from external sources easy.
Stars: ✭ 35 (-33.96%)
Mutual labels:  dotenv, environment-variables, env
dotenvy
Speed up your production sites by ditching .env for key/value variable pairs as Apache, Nginx, and shell equivalents
Stars: ✭ 31 (-41.51%)
Mutual labels:  dotenv, environment-variables, env
dotenv.net
A library to read .env files in a .NET Core environment
Stars: ✭ 126 (+137.74%)
Mutual labels:  dotenv, environment-variables
tfenv
Transform environment variables for use with Terraform (e.g. `HOSTNAME` ⇨ `TF_VAR_hostname`)
Stars: ✭ 120 (+126.42%)
Mutual labels:  environment-variables, env
envsafe
🔒 Makes sure you don't accidentally deploy apps with missing or invalid environment variables.
Stars: ✭ 705 (+1230.19%)
Mutual labels:  environment-variables, env
Dotenv Kotlin
🗝️ Dotenv is a module that loads environment variables from a .env file
Stars: ✭ 326 (+515.09%)
Mutual labels:  dotenv, environment-variables
gconfigs
gConfigs - Config and Secret parser
Stars: ✭ 42 (-20.75%)
Mutual labels:  dotenv, environment-variables
ngx-env
Easily inject environment variables into your Angular applications
Stars: ✭ 73 (+37.74%)
Mutual labels:  dotenv, environment-variables
Phpdotenv
Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
Stars: ✭ 11,648 (+21877.36%)
Mutual labels:  dotenv, environment-variables
envclasses
envclasses is a library to map fields on dataclass object to environment variables.
Stars: ✭ 26 (-50.94%)
Mutual labels:  environment-variables, env
cypress-dotenv
Cypress plugin that enables compatability with dotenv
Stars: ✭ 47 (-11.32%)
Mutual labels:  dotenv, environment-variables
Dotenv Webpack
A secure webpack plugin that supports dotenv and other environment variables and only exposes what you choose and use.
Stars: ✭ 1,022 (+1828.3%)
Mutual labels:  dotenv, environment-variables
Dotenv Flow
Loads environment variables from .env.[development|test|production][.local] files for Node.js® projects.
Stars: ✭ 537 (+913.21%)
Mutual labels:  dotenv, environment-variables
Dotenv Java
🗝️ Dotenv is a no-dep, pure Java module that loads environment variables from a .env file
Stars: ✭ 72 (+35.85%)
Mutual labels:  dotenv, environment-variables
dotenv validator
This gem check if required env variables are present and its format using the .env and .env.sample files from Dotenv.
Stars: ✭ 33 (-37.74%)
Mutual labels:  dotenv, env

Webpack dotenv plugin

Use dotenv with webpack.

Motivation

dotenv is a fantastic and useful way to manage environment variables. I wanted to keep the good times going when working with webpack for frontend projects.

Install

npm i --save-dev webpack-dotenv-plugin

Usage

webpack-dotenv-plugin uses dotenv-safe under the hood to read and check environment variables. The same options that can be passed to dotenv-safe can be passed to this plugin.

It then reads, parses and exports the listed env vars from .env into stringified process.env so it can be bundled for use with webpack.

Externally set environment variables will override vars set in .env.

// webpack.config.js
const DotenvPlugin = require('webpack-dotenv-plugin');

module.exports = {
  ...
  plugins: [
    new DotenvPlugin({
      sample: './.env.default',
      path: './.env'
    })
  ]
  ...
};
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].