Skip to content

Commit b8e2225

Browse files
Kent C. Doddsgaearon
Kent C. Dodds
authored andcommitted
add experimental babel-plugin-macros support (#3675)
* add experimental babel-plugin-macros support closes #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](#2730 (comment)) and it worked well. * Pin the version
1 parent df8614a commit b8e2225

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/babel-preset-react-app/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
'use strict';
88

99
const plugins = [
10+
// Experimental macros support. Will be documented after it's had some time
11+
// in the wild.
12+
require.resolve('babel-plugin-macros'),
1013
// Necessary to include regardless of the environment because
1114
// in practice some other transforms (such as object-rest-spread)
1215
// don't work without it: https://github.com/babel/babel/issues/7215

packages/babel-preset-react-app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
],
1313
"dependencies": {
1414
"babel-plugin-dynamic-import-node": "1.1.0",
15+
"babel-plugin-macros": "2.0.0",
1516
"babel-plugin-syntax-dynamic-import": "6.18.0",
1617
"babel-plugin-transform-class-properties": "6.24.1",
1718
"babel-plugin-transform-es2015-destructuring": "6.23.0",

0 commit comments

Comments
 (0)