File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 22function rewireGraphQLTag ( config , env ) {
33 const gqlExtension = / \. ( g r a p h q l | g q l ) $ /
44
5- const fileLoader = config . module . rules . find ( rule => rule . loader && rule . loader . indexOf ( "file-loader" ) !== - 1 ) ;
6- fileLoader . exclude . push ( gqlExtension ) ;
5+ const flatten = ( array ) => array . reduce ( ( a , b ) =>
6+ a . concat ( Array . isArray ( b ) ? flatten ( b ) : b ) , [ ] ) ;
7+
8+ const fileLoader = flatten ( config . module . rules . map ( ( rule ) => rule . oneOf || rule ) )
9+ . find ( ( rule ) => rule . loader && rule . loader . indexOf ( "file-loader" ) !== - 1 ) ;
10+
11+ fileLoader && fileLoader . exclude . push ( gqlExtension ) ;
712
813 const gqlTagRule = {
914 test : gqlExtension ,
Original file line number Diff line number Diff line change 11{
22 "name" : " react-app-rewire-graphql-tag" ,
3- "version" : " 1.0 .0" ,
3+ "version" : " 1.1 .0" ,
44 "description" : " rewire your react-app and use graphql-tag" ,
55 "main" : " index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments