# vuepress-plugin-env-define

> vuepress环境变量注入插件

Latest version **1.0.2** (published 2022-03-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install vuepress-plugin-env-define
pnpm add vuepress-plugin-env-define
yarn add vuepress-plugin-env-define
bun add vuepress-plugin-env-define
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-03-08 |
| First published | 2022-03-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | AnHyun |
| Maintainers | anhyun |
| Keywords | vuepress, vuepress-plugin |

## Links

- npm: https://www.npmjs.com/package/vuepress-plugin-env-define
- Repository: https://github.com/AnHyun/vuepress-plugin-env-define
- Homepage: https://github.com/AnHyun/vuepress-plugin-env-define#readme
- Issues: https://github.com/AnHyun/vuepress-plugin-env-define/issues
- npm.io page: https://npm.io/package/vuepress-plugin-env-define

## Dependencies (3)

- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [dotenv-expand](https://npm.io/package/dotenv-expand.md) ^5.1.0

## Recent versions

- 1.0.2 (latest) — 2022-03-08
- 1.0.1 — 2022-03-08
- 1.0.0 — 2022-03-08

## README

# vuepress-plugin-env-define

### 使用方法

1. 安装
   npm install vuepress-plugin-env-define

2. package.json 文件中配置

```json
{
  "scripts": {
    "docs:dev": "vuepress dev docs",
    "build:dev": "vuepress build docs",
    "build:test": "vuepress build docs",
    "build:prod": "vuepress build docs"
  }
}
```

3. 在 docs 目录下新增.env 文件
   例如： .env.dev、.env.test、.env.prod 并在文件中配置环境变量

```sh
.env                # 在所有的环境中被载入
.env.local          # 在所有的环境中被载入，但会被 git 忽略
.env.[mode]         # 只在指定的模式中被载入
.env.[mode].local   # 只在指定的模式中被载入，但会被 git 忽略
```

4. 在 config.js 文件中配置插件

```js
module.exports = {
  plugins: ["env-define"],
};
```

---
_Source: https://npm.io/package/vuepress-plugin-env-define · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
