Skip to content

Commit

Permalink
add experimental babel-plugin-macros support (facebook#3675)
Browse files Browse the repository at this point in the history
* add experimental babel-plugin-macros support

closes facebook#2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](facebook#2730 (comment))
and it worked well.

* Pin the version
  • Loading branch information
Kent C. Dodds authored and akstuhl committed Mar 15, 2018
1 parent d5395d8 commit 39a725a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/babel-preset-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
'use strict';

const plugins = [
// Experimental macros support. Will be documented after it's had some time
// in the wild.
require.resolve('babel-plugin-macros'),
// Necessary to include regardless of the environment because
// in practice some other transforms (such as object-rest-spread)
// don't work without it: https://github.com/babel/babel/issues/7215
Expand Down
1 change: 1 addition & 0 deletions packages/babel-preset-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
],
"dependencies": {
"babel-plugin-dynamic-import-node": "1.1.0",
"babel-plugin-macros": "2.0.0",
"babel-plugin-syntax-dynamic-import": "6.18.0",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-es2015-destructuring": "6.23.0",
Expand Down

0 comments on commit 39a725a

Please sign in to comment.