1.0.0 • Published 3 years ago

webpack-plugin-dotenv v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

Dotenv for Webpack HTML Plugin

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

Installation

$ npm install -D webpack-plugin-dotenv

Configuration

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

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

Options

NameTypeDefaultDescription
pathstring'.env'Dotenv file path
propertystring'env'Property name of environment object on window
templatebooleanfalseInject variable templates or values