https://github.com/byzanteam/dotenv-webpack-plugin
https://github.com/byzanteam/dotenv-webpack-plugin
webpack webpack-plugin
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/byzanteam/dotenv-webpack-plugin
- Owner: Byzanteam
- License: mit
- Created: 2020-05-07T08:12:54.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-04-26T23:57:18.000Z (about 3 years ago)
- Last Synced: 2025-02-28T16:56:58.686Z (over 1 year ago)
- Topics: webpack, webpack-plugin
- Language: JavaScript
- Size: 206 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dotenv for Webpack HTML Plugin
通过 `dotenv` 将环境变量挂在到浏览器 `window` 对象上。
## Installation
```bash
$ npm install -D dotenv-webpack-plugin
```
## Configuration
```js
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 |