babel-preset-vue is a Babel preset designed to enable Vue-specific JSX features, such as event modifiers (e.g., `onClick:prevent`) and `v-model` directives, within JavaScript files. It bundles and configures `babel-plugin-jsx-event-modifier` and `babel-plugin-jsx-v-model` to provide these functionalities, primarily targeting applications built with Vue 2. The package is currently at version 2.0.2 and appears to be unmaintained, with its last commit occurring in 2019 and last publish 4 years ago. It explicitly notes that some of its features are not available for Babel v7 or later. For modern Vue 3 projects and up-to-date Babel support, the recommended preset is `@vue/babel-preset-jsx` or `@vue/babel-plugin-jsx`, which offers similar functionalities with active maintenance and broader compatibility.
npm install babel-preset-vueNo compatibility data collected yet for this library.
Configures Babel via `.babelrc` to use the `babel-preset-vue` preset, explicitly showing how to enable or disable its core features for Vue-specific JSX transformations.
Migrate to `@vue/babel-preset-jsx` for Vue 2/3 compatibility with Babel 7+, or `@vue/babel-plugin-jsx` for Vue 3 specific projects.
Avoid using this preset for new projects. For existing projects, consider migrating to `@vue/babel-preset-jsx` or `@vue/babel-preset-app` (if using Vue CLI) to ensure compatibility and ongoing support.
Use `@vue/babel-preset-jsx` for Vue 3 projects that require JSX. This preset provides specific options for Vue 3's Composition API and other modern features.
When using TypeScript with Vue JSX, consider `babel-preset-typescript-vue` or `babel-preset-typescript-vue3` alongside or instead of this preset, or ensure your build setup correctly handles `.tsx` files if applicable.
Ensure the package is installed: `npm install --save-dev babel-preset-vue` or `yarn add --dev babel-preset-vue`.
Verify that `babel-preset-vue` is listed in your `.babelrc` or `babel.config.js` presets, and ensure its `eventModifiers` option is not set to `false`. If using Babel 7+, consider migrating to `@vue/babel-preset-jsx`.
Confirm `babel-preset-vue` is active in your Babel configuration and its `vModel` option is not `false`. For modern setups, `@vue/babel-preset-jsx` offers `v-model` support.