Byzanteam / dotenv-webpack-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dotenv for Webpack HTML Plugin

通过 dotenv 将环境变量挂在到浏览器 window 对象上。

Installation

$ npm install -D dotenv-webpack-plugin

Configuration

const HtmlWebpackPlugin = require('html-webpack-plugin')
const DotenvWebpackPlugin = require('dotenv-webpack-plugin')

module.exports = {
  ...
  plugins: [
    new HtmlWebpackPlugin(),
    new DotenvWebpackPlugin(),
  ],
  ...
}

Options

Name Type Default Description
dotenv object undefined Dotenv configuration options
property string 'env' Property name of environment object on window

About

License:MIT License


Languages

Language:JavaScript 100.0%