Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unplugin/unplugin-vue-jsx
Vue JSX plugin for both Vue 2 and 3. Support Rollup, Vite, esbuild, Webpack, and more.
https://github.com/unplugin/unplugin-vue-jsx
esbuild jsx rollup unplugin vite vue webpack
Last synced: 1 day ago
JSON representation
Vue JSX plugin for both Vue 2 and 3. Support Rollup, Vite, esbuild, Webpack, and more.
- Host: GitHub
- URL: https://github.com/unplugin/unplugin-vue-jsx
- Owner: unplugin
- License: mit
- Created: 2022-07-09T06:53:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T04:57:37.000Z (6 months ago)
- Last Synced: 2024-05-23T05:41:19.883Z (6 months ago)
- Topics: esbuild, jsx, rollup, unplugin, vite, vue, webpack
- Language: TypeScript
- Homepage:
- Size: 429 KB
- Stars: 24
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# unplugin-vue-jsx [![npm](https://img.shields.io/npm/v/unplugin-vue-jsx.svg)](https://npmjs.com/package/unplugin-vue-jsx)
[![Unit Test](https://github.com/unplugin/unplugin-vue-jsx/actions/workflows/unit-test.yml/badge.svg)](https://github.com/unplugin/unplugin-vue-jsx/actions/workflows/unit-test.yml)
- Vue JSX plugin for both Vue 2 and 3.
- Supports Rollup, Vite, esbuild and Webpack.## Installation
```bash
npm i unplugin-vue-jsx
```Vite
```ts
// vite.config.ts
import VueJsx from 'unplugin-vue-jsx/vite'export default defineConfig({
plugins: [VueJsx()],
})
```
Rollup
```ts
// rollup.config.js
import VueJsx from 'unplugin-vue-jsx/rollup'export default {
plugins: [VueJsx()],
}
```
esbuild
```ts
// esbuild.config.js
import { build } from 'esbuild'build({
plugins: [require('unplugin-vue-jsx/esbuild')()],
})
```
Webpack
```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [require('unplugin-vue-jsx/webpack')()],
}
```
Vue CLI
```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [require('unplugin-vue-jsx/webpack')()],
},
}
```
## Configuration
The following show the default values of the configuration.
```ts
VueJsx({
// filters for transforming targets
include: [/\.[jt]sx?$/],
exclude: undefined,root: process.cwd(),
sourceMap: true,/** detect vue version from node_modules automatically */
version: 'auto',// extra options from babel plugin
// Vue 2 options: https://github.com/vuejs/jsx-vue2/tree/dev/packages/babel-preset-jsx#usage
// Vue 3 options: https://github.com/vuejs/babel-plugin-jsx#options
})
```## Sponsors
## License
[MIT](./LICENSE) License © 2022-PRESENT [三咲智子](https://github.com/sxzz)