@babel/plugin-syntax-jsx

Syntax only

Using this plugin directly only enables Babel to parse this syntax. If you want to transform JSX syntax then use the transform-react-jsx plugin or react preset to both parse and transform this syntax.

Installation

  1. npm install --save-dev @babel/plugin-syntax-jsx

Usage

  1. {
  2. "plugins": ["@babel/plugin-syntax-jsx"]
  3. }

Via CLI

  1. babel --plugins @babel/plugin-syntax-jsx script.js

Via Node API

  1. require("@babel/core").transformSync("code", {
  2. plugins: ["@babel/plugin-syntax-jsx"],
  3. });