# vite-jsx

> Help use directives such as v-if in the jsx of vite

Latest version **1.0.6** (published 2020-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install vite-jsx
pnpm add vite-jsx
yarn add vite-jsx
bun add vite-jsx
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-09-29 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | cereschen |
| Maintainers | cereschen |
| Keywords | vite, jsx, directive |

## Links

- npm: https://www.npmjs.com/package/vite-jsx
- Repository: https://github.com/cereschen/vite-jsx
- Homepage: https://github.com/cereschen/vite-jsx/tree/master
- Issues: https://github.com/cereschen/vite-jsx/issues
- npm.io page: https://npm.io/package/vite-jsx

## Dependencies (1)

- [magic-string](https://npm.io/package/magic-string.md) ^0.25.7

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2020-09-29
- 1.0.5 — 2020-09-17
- 1.0.4 — 2020-09-16
- 1.0.3 — 2020-09-07
- 1.0.2 — 2020-08-25
- 1.0.1 — 2020-08-24
- 1.0.0 — 2020-08-24

## README

# vite-jsx
Help use directives such as v-if in the jsx of vite
## Usage
Run  `npm install vite-jsx`

or `yarn add vite-jsx`

Add to `vite.config.js`

```js
import { createJsxPlugin } from "vite-jsx/plugin"

 module.exports = {
  plugins: [createJsxPlugin()],
  ...
}
```
## Directives
-  v-if
-  v-else-if
-  v-else
-  v-show
-  v-text
-  v-html
-  v-model
   
   modifiers : `sync`, `number`,  `trim`,  `lazy`

   example : `v-model_value = v-model:value `
   
   `v-model_trim_number = v-model.trim.number `

## IntelliSense
### add to your *.d.ts
 ```ts
 declare namespace JSX {
  interface IntrinsicAttributes {
    ['v-if']?: unknown
    ['v-else-if']?: unknown
    ['v-else']?: unknown
    ['v-show']?: unknown
    ['v-html']?: unknown
    ['v-text']?: unknown
    ['v-model']?: unknown
  }
}
```
## TODO
- performance optimization

---
_Source: https://npm.io/package/vite-jsx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
