File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,17 @@ const App = () => (
3838 < / div>
3939)
4040```
41+
42+ Also you can pass options to svgr webpack loader via third parameter
43+ ``` js
44+ /* config-overrides.js */
45+
46+ const rewireSVGR = require (' react-app-rewire-svgr' );
47+
48+ module .exports = function override (config , env ) {
49+ // ...
50+ config = rewireSVGR (config, env, { svgo: false });
51+ // ...
52+ return config;
53+ }
54+ ```
Original file line number Diff line number Diff line change 11const { getBabelLoader } = require ( `react-app-rewired` )
22
3- function rewireSVGR ( config ) {
3+ function rewireSVGR ( config , env , svgrLoaderOptions ) {
44 const babelLoader = getBabelLoader ( config . module . rules )
55 const svgReactLoader = {
66 test : / \. s v g $ / ,
@@ -9,7 +9,10 @@ function rewireSVGR(config) {
99 loader : babelLoader . loader ,
1010 options : babelLoader . options ,
1111 } ,
12- { loader : require . resolve ( `svgr/webpack` ) } ,
12+ {
13+ loader : require . resolve ( `svgr/webpack` ) ,
14+ options : svgrLoaderOptions
15+ } ,
1316 ] ,
1417 }
1518
You can’t perform that action at this time.
0 commit comments