Babel Preset for Vue JSX

2.0.2 · abandoned · verified Sun Apr 19

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.

Common errors

Warnings

Install

Quickstart

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.

{
  "presets": [
    ["vue", {
      "eventModifiers": true, // Enable event modifiers, default is true
      "vModel": true          // Enable v-model support, default is true
    }]
  ]
}

view raw JSON →