@uni-helper/uni-env
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@uni-helper/uni-env

在 uni-app 中优雅的判断当前环境

npm version npm downloads bundle License JSDocs

安装

pnpm i @uni-helper/uni-env

使用

// ESM
import { isMpWeixin } from '@uni-helper/uni-env'

// CommonJS
const { isMp } = require('@uni-helper/uni-env')

[!NOTE] 这个包更多的是为插件开发者提供,如果你在运行时引入并不能做到条件编译。 要做条件编译的话,请使用官方的 跨端兼容 - 条件编译,如果你需要更好的条件编译,你可以使用 unplugin-preprocessor-directives

Readme

Keywords

Package Sidebar

Install

npm i @uni-helper/uni-env

Weekly Downloads

1,908

Version

0.1.2

License

MIT

Unpacked Size

26.3 kB

Total Files

8

Last publish

Collaborators

  • zguolee
  • modyqyw
  • kejunmao