react-native-condition-pack

1.0.0 • Public • Published

Example

In

if (__APP_TYPE__ === "fy") {
    console.log("fy")
} else if (__APP_TYPE__ === "xmf") {
    console.log("xmf")
}

Out

__APP_TYPE__打包变量为 fy

console.log("fy")

__APP_TYPE__打包变量为 xmf

console.log("xmf")

Installation

npm install --save-dev babel-plugin-condition-pack

Usage

{
    "plugins": [
        ["babel-plugin-condition-pack"], 
        {
            __APP_TYPE__: "xmf",
            __PLATFORM__: "ios"
        }
    ]
}

Package Sidebar

Install

npm i react-native-condition-pack

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

7.86 kB

Total Files

5

Last publish

Collaborators

  • wythetan