2.0.1 • Published 2 years ago

@narrative/swc-plugin-compiler v2.0.1

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

@narrative/swc-plugin-compiler

The compiler for @narrative/control-flow.

Check more details in documentation.

Usage

npm install @narrative/swc-plugin-compiler

Configure swc

{
  "jsc": {
    "experimental": {
      "plugins": [["@narrative/swc-plugin-compiler", {}]]
    }
  }
}

How it works

<If when={index > 5}>
  <li>{todo * 2}</li>
  <ElseIf when={index > 10}>
    <li>{todo * 3}</li>
  </ElseIf>
</If>

Compiled ↓ ↓ ↓ ↓ ↓ ↓

index > 5 ? <li>{todo * 2}</li> : index > 10 ? <li>{todo * 3}</li> : null
1.1.0

2 years ago

1.0.0

2 years ago

0.1.3

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago