File tree 3 files changed +57
-0
lines changed
3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ # react-app-rewire-graphql-tag
2
+
3
+ ## Usage:
4
+
5
+ Make sure you have installed [ react-app-rewire] (https://github.com/timarney/react-app-rewired ),
6
+ ```
7
+ yarn add react-app-rewire-graphql-tag
8
+ ```
9
+ in config-overrides.js:
10
+ ```
11
+ const rewireGqlTag = require('react-app-rewire-graphql-tag');
12
+
13
+ module.exports = function override(config, env) {
14
+ conf = rewireGqlTag(config,env);
15
+ return conf;
16
+ }
17
+ ```
Original file line number Diff line number Diff line change
1
+
2
+ function rewireGraphQLTag ( config , env ) {
3
+ const gqlTagExtension = / \. ( g r a p h q l | g q l ) $ /
4
+
5
+ const fileLoader = config . module . rules . find ( rule => rule . loader && rule . loader . indexOf ( "file-loader" ) !== - 1 ) ;
6
+ fileLoader . exclude . push ( gqlExtension ) ;
7
+
8
+ const gqlTagRule = {
9
+ test : gqlTagExtension ,
10
+ loader : 'graphql-tag/loader' ,
11
+ exclude : / n o d e _ m o d u l e s /
12
+ }
13
+ config . module . rules . push ( gqlTagRule ) ;
14
+
15
+ return config ;
16
+ }
17
+
18
+ module . exports = rewireGraphQLTag ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " react-app-rewire-graphql-tag" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " rewire your react-app and use graphql-tag" ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "test" : " echo \" Error: no test specified\" && exit 1"
8
+ },
9
+ "dependencies" : {
10
+ "graphql-tag" : " ^2.4.2" ,
11
+ },
12
+ "repository" : {
13
+ "type" : " git" ,
14
+ "url" : " git+https://github.com/tkvw/react-app-rewire-graphql-tag.git"
15
+ },
16
+ "author" : " Dennie de Lange" ,
17
+ "license" : " MIT" ,
18
+ "bugs" : {
19
+ "url" : " https://github.com/tkvw/react-app-rewire-graphql-tag/issues"
20
+ },
21
+ "homepage" : " https://github.com/tkvw/react-app-rewire-graphql-tag#readme"
22
+ }
You can’t perform that action at this time.
0 commit comments