Babel
  • Docs
  • Setup
  • Try it out
  • Videos
  • Blog
  • Donate
  • Team
  • GitHub
Edit

@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

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

Usage

With a configuration file (Recommended)

{
  "plugins": ["@babel/plugin-syntax-jsx"]
}

Via CLI

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

Via Node API

require("@babel/core").transformSync("code", {
  plugins: ["@babel/plugin-syntax-jsx"],
});
  • Installation
  • Usage
    • With a configuration file (Recommended)
    • Via CLI
    • Via Node API
Babel
Docs
Learn ES2015
Community
VideosUser ShowcaseStack OverflowSlack ChannelTwitter
More
BlogGitHub OrgGitHub RepoWebsite RepoOld 6.x SiteOld 5.x Site