# @vue/babel-preset-jsx

> Babel preset for Vue JSX

Latest version **1.4.0** (published 2022-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vue/babel-preset-jsx
pnpm add @vue/babel-preset-jsx
yarn add @vue/babel-preset-jsx
bun add @vue/babel-preset-jsx
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2022-08-25 |
| First published | 2018-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1476 |
| Author | Nick Messing |
| Maintainers | nickmessing, soda, yyx990803 |

## Links

- npm: https://www.npmjs.com/package/@vue/babel-preset-jsx
- Repository: https://github.com/vuejs/jsx.git#master
- Homepage: https://github.com/vuejs/jsx/tree/master#readme
- Issues: https://github.com/vuejs/jsx/issues
- npm.io page: https://npm.io/package/@vue/babel-preset-jsx

## Dependencies (8)

- [@vue/babel-sugar-v-on](https://npm.io/package/@vue/babel-sugar-v-on.md) ^1.4.0
- [@vue/babel-sugar-v-model](https://npm.io/package/@vue/babel-sugar-v-model.md) ^1.4.0
- [@vue/babel-sugar-inject-h](https://npm.io/package/@vue/babel-sugar-inject-h.md) ^1.4.0
- [@vue/babel-sugar-functional-vue](https://npm.io/package/@vue/babel-sugar-functional-vue.md) ^1.4.0
- [@vue/babel-plugin-transform-vue-jsx](https://npm.io/package/@vue/babel-plugin-transform-vue-jsx.md) ^1.4.0
- [@vue/babel-helper-vue-jsx-merge-props](https://npm.io/package/@vue/babel-helper-vue-jsx-merge-props.md) ^1.4.0
- [@vue/babel-sugar-composition-api-inject-h](https://npm.io/package/@vue/babel-sugar-composition-api-inject-h.md) ^1.4.0
- [@vue/babel-sugar-composition-api-render-instance](https://npm.io/package/@vue/babel-sugar-composition-api-render-instance.md) ^1.4.0

## Recent versions

- 1.4.0 (latest) — 2022-08-25
- 1.3.1 — 2022-07-21
- 1.3.0 — 2022-07-06
- 1.2.4 — 2020-10-27
- 1.2.3 — 2020-10-20
- 1.2.2 — 2020-10-17
- 1.2.1 — 2020-10-16
- 1.2.0 — 2020-10-16
- 1.1.2 — 2019-11-09
- 1.1.1 — 2019-10-11
- 1.1.0 — 2019-07-23
- 1.0.0 — 2019-05-08
- 1.0.0-beta.3 — 2019-03-22
- 1.0.0-beta.2 — 2019-01-11
- 1.0.0-beta.1 — 2018-12-25
- … 1 more at https://npm.io/package/@vue/babel-preset-jsx/versions

## README

## @vue/babel-preset-jsx

Configurable preset for Vue JSX plugins.

### Babel Compatibility Notes

- This repo is only compatible with Babel 7.x, for 6.x please use [vuejs/babel-plugin-transform-vue-jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx)

### Usage

Install the dependencies:

```sh
# for yarn:
yarn add @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props
# for npm:
npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props --save
```

In your `babel.config.js`:

```js
module.exports = {
  presets: ['@vue/babel-preset-jsx'],
}
```

You can toggle specific features, by default all features (except `compositionAPI`) are enabled, e.g.:

```js
module.exports = {
  presets: [
    [
      '@vue/babel-preset-jsx',
      {
        vModel: false,
        compositionAPI: true,
      },
    ],
  ],
}
```

Options are:

- `compositionAPI` - Enables [@vue/babel-sugar-composition-api-inject-h](../babel-sugar-composition-api-inject-h) and [@vue/babel-sugar-composition-api-render-instance](../babel-sugar-composition-api-render-instance), support returning render function in `setup`.
  - The default value is `false`;
  - When set to `'auto'` (or `true`), it will detect the Vue version in the project. If it's >= 2.7, it will import the composition utilities from `vue`, otherwise from `@vue/composition-api`;
  - When set to `'native'` (or `'naruto'`), it will always import the composition utilities from `vue`
  - When set to `plugin`, it will always import the composition utilities from `@vue/composition-api`, but it will redirect to `'vue'` itself when the vue version is `2.7.x`
  - When set to `vue-demi`, it will always import the composition utilities from `vue-demi`
  - When set to an object like `{ importSource: string; }`, it will always import the composition utilities from the importSource you set
- `functional` [@vue/babel-sugar-functional-vue](../babel-sugar-functional-vue/README.md) - Functional components syntactic sugar
- `injectH` [@vue/babel-sugar-inject-h](../babel-sugar-inject-h/README.md) - Automatic `h` injection syntactic sugar
- `vModel` [@vue/babel-sugar-v-model](../babel-sugar-v-model/README.md) - `vModel` syntactic sugar
- `vOn` [@vue/babel-sugar-v-on](../babel-sugar-v-on/README.md) - `vOn` syntactic sugar

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