|
| 1 | +# vue-jsx-vapor |
| 2 | + |
| 3 | +[](https://www.npmjs.com/package/vue-jsx-vapor) |
| 4 | + |
| 5 | +Vapor Mode of Vue JSX. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- ⚡️ High Performance: It has the same performance as Vue Vapor! |
| 10 | +- ⚒️ Directives: Support all build-in directives of Vue. |
| 11 | +- ✨ Macros: Support most macros of Vue, Friendly to JSX. |
| 12 | +- 🦀 Compiler rewritten in Rust: Based on Oxc, 20x performance improvement over Babel plugin. |
| 13 | +- 🦾 Type Safe: Provide Volar plugin support by install TS Macro (VSCode plugin). |
| 14 | +- ⚙️ ESLint: Provide an ESLint plugin for vue-jsx-vapor to automatically format code. |
| 15 | + |
| 16 | +## Installation |
| 17 | + |
| 18 | +```bash |
| 19 | +npm i vue-jsx-vapor |
| 20 | +``` |
| 21 | + |
| 22 | +## Usage |
| 23 | + |
| 24 | +- [📜 Documentation](https://jsx-vapor.netlify.app/) |
| 25 | +- [🛰️ Playground](https://repl.zmjs.dev/vuejs/vue-jsx-vapor) |
| 26 | + |
| 27 | +<details> |
| 28 | +<summary>Vite</summary><br> |
| 29 | + |
| 30 | +```ts |
| 31 | +// vite.config.ts |
| 32 | +import VueJsxVapor from 'vue-jsx-vapor/vite' |
| 33 | + |
| 34 | +export default defineConfig({ |
| 35 | + plugins: [VueJsxVapor()], |
| 36 | +}) |
| 37 | +``` |
| 38 | + |
| 39 | +Example: [`playground/`](./playground/) |
| 40 | + |
| 41 | +<br></details> |
| 42 | + |
| 43 | +<details> |
| 44 | +<summary>Rollup</summary><br> |
| 45 | + |
| 46 | +```ts |
| 47 | +// rollup.config.js |
| 48 | +import VueJsxVapor from 'vue-jsx-vapor/rollup' |
| 49 | + |
| 50 | +export default { |
| 51 | + plugins: [VueJsxVapor()], |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +<br></details> |
| 56 | + |
| 57 | +<details> |
| 58 | +<summary>Webpack</summary><br> |
| 59 | + |
| 60 | +```ts |
| 61 | +// webpack.config.js |
| 62 | +module.exports = { |
| 63 | + /* ... */ |
| 64 | + plugins: [require('vue-jsx-vapor/webpack')()], |
| 65 | +} |
| 66 | +``` |
| 67 | + |
| 68 | +<br></details> |
| 69 | + |
| 70 | +<details> |
| 71 | +<summary>Nuxt</summary><br> |
| 72 | + |
| 73 | +```ts |
| 74 | +// nuxt.config.js |
| 75 | +export default defineNuxtConfig({ |
| 76 | + modules: ['vue-jsx-vapor/nuxt'], |
| 77 | +}) |
| 78 | +``` |
| 79 | + |
| 80 | +> This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite) |
| 81 | +
|
| 82 | +<br></details> |
| 83 | + |
| 84 | +<details> |
| 85 | +<summary>Vue CLI</summary><br> |
| 86 | + |
| 87 | +```ts |
| 88 | +// vue.config.js |
| 89 | +module.exports = { |
| 90 | + configureWebpack: { |
| 91 | + plugins: [require('vue-jsx-vapor/webpack')()], |
| 92 | + }, |
| 93 | +} |
| 94 | +``` |
| 95 | + |
| 96 | +<br></details> |
| 97 | + |
| 98 | +<details> |
| 99 | +<summary>esbuild</summary><br> |
| 100 | + |
| 101 | +```ts |
| 102 | +// esbuild.config.js |
| 103 | +import { build } from 'esbuild' |
| 104 | +import VueJsxVapor from 'vue-jsx-vapor/esbuild' |
| 105 | + |
| 106 | +build({ |
| 107 | + plugins: [VueJsxVapor()], |
| 108 | +}) |
| 109 | +``` |
| 110 | + |
| 111 | +<br></details> |
0 commit comments