Skip to content

lexmin0412/taro-plugin-check-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

taro-plugin-check-env

taro插件,用于在编译前的环境检查,包括以下功能:

  • taro版本检查
  • 环境变量检查

Installation

npm install taro-plugin-check-env -D -S

Usage

在 config/index.js 中配置 plugins

// config/index.js

const config = {
  plugins: [
    [
      // 环境变量检查插件
      'taro-plugin-check-env',
      {
        // 配置需要检查的环境变量
        ENV_LIST: {
          CUSTOMIZE_ENV: '自定义环境变量',
          API_HOST: '接口API域名',
          APPID: '小程序APPID',
          API_MAP_QQ: '腾讯地图API/WebService域名',
          KEY_MAP_QQ: '腾讯地图Key',
        },
        // 指定不同平台对应的taro版本
        taroVersion: {
          h5: '2.2.7',
          weapp: '2.2.11'
        }
      },
    ]
  ]
}

在编译初始阶段,插件将会在命令行中打印出传入的环境变量列表的检查结果,如果缺少变量则会抛出错误。

About

taro插件,用于在编译前的环境变量检查,支持传入需要检查的环境变量列表及对应提示

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published