@@ -98,13 +98,36 @@ module.exports = function (webpackConfig, isDevelopment) {
9898};
9999```
100100related issues: [ #107 ] [ 107 ] , [ #167 ] [ 167 ] , [ #214 ] [ 214 ] , [ #309 ] [ 309 ] , [ #411 ] [ 411 ] , [ #1357 ] [ 1357 ]
101+
102+ ### Relay support
103+ - install ` babel-relay-plugin ` :
104+ ```
105+ npm install --save-dev babel-relay-plugin
106+ ```
107+ - add ` relayPlugin.js ` file:
108+ ``` js
109+ const getBabelRelayPlugin = require (' babel-relay-plugin' );
110+ const schemaData = require (' ./graphql.schema.json' );
111+ const relayPlugin = getBabelRelayPlugin (schemaData .data );
112+ module .exports = relayPlugin;
113+ ```
114+ - edit ` webpack.monkey.js ` like this:
115+ ``` js
116+ /* copy findLoader, addBabelPlugins from decorator example */
117+ module .exports = function (webpackConfig , isDevelopment ) {
118+ addBabelPlugins (webpackConfig, [
119+ require .resolve (' ./relayPlugin.js' )
120+ ]);
121+ };
122+ ```
123+ related issues: [ #462 ] [ 462 ] , [ #662 ] [ 662 ] , [ #900 ] [ 900 ]
101124## TODOs
102125- [ ] add helpers
103126- [ ] customize test runner (jest)
104127- [ ] add more example
105128 - [ ] scss support
106129 - [x] decorator support
107- - [ ] relay support
130+ - [x ] relay support
108131
109132## Thanks
110133@svrcekmichal for [ configurable-react-scripts] [ configurable-react-scripts ]
@@ -119,3 +142,7 @@ related issues: [#107][107], [#167][167], [#214][214], [#309][309], [#411][411],
119142[ 309 ] : https://github.com/facebookincubator/create-react-app/issues/309
120143[ 411 ] : https://github.com/facebookincubator/create-react-app/issues/411
121144[ 1357 ] : https://github.com/facebookincubator/create-react-app/issues/1357
145+
146+ [ 462 ] : https://github.com/facebookincubator/create-react-app/issues/462
147+ [ 662 ] : https://github.com/facebookincubator/create-react-app/pull/662
148+ [ 900 ] : https://github.com/facebookincubator/create-react-app/issues/900
0 commit comments