Vue 2 JSX Babel Transform (for Babel 6)

3.7.0 · abandoned · verified Sun Apr 19

This Babel plugin, `babel-plugin-transform-vue-jsx`, provides JSX syntax support specifically for Vue.js 2.x applications when used with Babel 6. Its primary function is to transpile JSX elements within Vue components into `h` (createElement) function calls, enabling developers to write render functions using a more declarative, React-like syntax. The version 3.7.0, as specified, is part of the older branch designed for Babel 6. It is no longer actively maintained. For projects utilizing Babel 7 and Vue 2, the successor plugin `@vue/babel-plugin-transform-vue-jsx` (latest v1.4.0, published 4 years ago) should be used instead. For Vue 3 projects, `@vue/babel-plugin-jsx` (latest v2.0.1, published 5 months ago) is the recommended and actively maintained solution. This particular package (`babel-plugin-transform-vue-jsx` v3.7.0) does not follow a regular release cadence and is considered superseded for modern development environments.

Common errors

Warnings

Install

Imports

Quickstart

This .babelrc configuration enables JSX transformation for Vue 2 applications using Babel 6. It includes the necessary syntax plugin and the transform plugin.

{
  "presets": [
    ["env", {
      "targets": { "node": "current" }
    }]
  ],
  "plugins": [
    "babel-plugin-syntax-jsx",
    "babel-plugin-transform-vue-jsx"
  ]
}

view raw JSON →