babel-preset-react

Babel preset for all React plugins.

MIT 37 个版本
安装
npm install babel-preset-react
yarn add babel-preset-react
pnpm add babel-preset-react
bun add babel-preset-react
README

babel-preset-react

Babel preset for all React plugins.

This preset includes the following plugins/presets:

Install

You can also check out the React Getting Started page

For more info, check out the setup page on the cli and the usage docs.

Install the CLI and this preset

npm install --save-dev babel-cli babel-preset-react

Make a .babelrc config file with the preset

echo '{ "presets": ["react"] }' > .babelrc

Create a file to run on

echo '<h1>Hello, world!</h1>' > index.js

View the output

./node_modules/.bin/babel index.js

Usage

.babelrc

{
  "presets": ["react"]
}

Via CLI

babel script.js --presets react 

Via Node API

require("babel-core").transform("code", {
  presets: ["react"]
});
版本列表
7.0.0-beta.3 2017-10-15
7.0.0-beta.2 2017-09-26
7.0.0-beta.1 2017-09-19
7.0.0-beta.0 2017-09-12
7.0.0-alpha.20 2017-08-30
7.0.0-alpha.19 2017-08-07
7.0.0-alpha.18 2017-08-03
7.0.0-alpha.17 2017-07-26
7.0.0-alpha.16 2017-07-25
7.0.0-alpha.15 2017-07-12
7.0.0-alpha.14 2017-07-12
7.0.0-alpha.12 2017-05-31
7.0.0-alpha.11 2017-05-31
7.0.0-alpha.10 2017-05-25
7.0.0-alpha.9 2017-04-18
7.0.0-alpha.8 2017-04-17
7.0.0-alpha.7 2017-04-05
7.0.0-alpha.3 2017-03-23
7.0.0-alpha.1 2017-03-02
6.24.1 2017-04-07
6.23.0 2017-02-14
6.22.0 2017-01-20
6.16.0 2016-09-28
6.11.1 2016-06-27
6.11.0 2016-06-27
6.5.0-1 2016-02-07
6.5.0 2016-02-07
6.3.13 2015-12-04
6.2.4 2015-11-25
6.1.18 2015-11-12
6.1.17 2015-11-12
6.1.4 2015-11-11
6.1.2 2015-11-05
6.0.15 2015-11-01
6.0.14 2015-10-30
6.0.12 2015-10-30
6.0.2 2015-10-29