Skip to content

Commit

Permalink
Enable useBuiltIns with transform-react-jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
existentialism committed Nov 20, 2016
1 parent ab5d90b commit e73f3f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/babel-preset-react-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Then create a file named `.babelrc` with following contents in the root folder o
}
```

This preset uses the `useBuiltIns` option with [transform-object-rest-spread](http://babeljs.io/docs/plugins/transform-object-rest-spread/), which assumes `Object.assign` is available or polyfilled.
This preset uses the `useBuiltIns` option with [transform-object-rest-spread](http://babeljs.io/docs/plugins/transform-object-rest-spread/) and [transform-react-jsx](http://babeljs.io/docs/plugins/transform-react-jsx/), which assumes that `Object.assign` is available or polyfilled.
8 changes: 6 additions & 2 deletions packages/babel-preset-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ var path = require('path');
const plugins = [
// class { handleClick = () => { } }
require.resolve('babel-plugin-transform-class-properties'),
// The following two plugins use Object.assign directly, instead of Babel's
// extends helper. Note that this assumes `Object.assign` is available.
// { ...todo, completed: true }
[require.resolve('babel-plugin-transform-object-rest-spread'), {
// Use Object.assign directly, instead of extends helper. Note that this
// assumes Object.assign is available/polyfilled.
useBuiltIns: true
}],
// Transforms JSX
[require.resolve('babel-plugin-transform-react-jsx'), {
useBuiltIns: true
}],
// function* () { yield 42; yield 43; }
Expand Down

0 comments on commit e73f3f0

Please sign in to comment.