🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@mjk/webpack-dotenv-extended-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mjk/webpack-dotenv-extended-plugin

Use dotenv-extended with webpack.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Webpack dotenv-extended plugin

Use dotenv-extended 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-extended-plugin

Usage

webpack-dotenv-extended-plugin uses dotenv-extended under the hood to read and check environment variables. The same options that can be passed to dotenv-extended 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-extended-plugin');

module.exports = {
  ...
  plugins: [
    new DotenvPlugin({
      schema: './.env.schema',
      defaults: './.env.defaults',
      path: './.env'
    })
  ]
  ...
};

Keywords

webpack

FAQs

Package last updated on 27 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts