1.0.2 • Published 2 years ago

vuepress-plugin-env-define v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

vuepress-plugin-env-define

使用方法

  1. 安装 npm install vuepress-plugin-env-define

  2. package.json 文件中配置

{
  "scripts": {
    "docs:dev": "vuepress dev docs",
    "build:dev": "vuepress build docs",
    "build:test": "vuepress build docs",
    "build:prod": "vuepress build docs"
  }
}
  1. 在 docs 目录下新增.env 文件 例如: .env.dev、.env.test、.env.prod 并在文件中配置环境变量
.env                # 在所有的环境中被载入
.env.local          # 在所有的环境中被载入,但会被 git 忽略
.env.[mode]         # 只在指定的模式中被载入
.env.[mode].local   # 只在指定的模式中被载入,但会被 git 忽略
  1. 在 config.js 文件中配置插件
module.exports = {
  plugins: ["env-define"],
};
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago