You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/rollup/README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,10 @@ const App = () => (
65
65
66
66
The named export defaults to `ReactComponent`, but can be customized with the `namedExport` option.
67
67
68
+
Please note that by default, `@svgr/rollup` will try to export the React Component via default export if there is no other plugin handling svg files with default export. When there is already any other plugin using default export for svg files, `@svgr/rollup` will always export the React component via named export.
69
+
70
+
If you prefer named export in any case, you may set the `exportType` option to `named`.
71
+
68
72
### Use your own Babel configuration
69
73
70
74
By default, `@svgr/rollup` applies a babel transformation with [optimized configuration](https://github.com/smooth-code/svgr/blob/master/packages/rollup/src/index.js). In some case you may want to apply a custom one (if you are using Preact for an example). You can turn off Babel transformation by specifying `babel: false` in options.
Copy file name to clipboardExpand all lines: packages/webpack/README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,10 @@ const App = () => (
77
77
78
78
The named export defaults to `ReactComponent`, but can be customized with the `namedExport` option.
79
79
80
+
Please note that by default, `@svgr/webpack` will try to export the React Component via default export if there is no other loader handling svg files with default export. When there is already any other loader using default export for svg files, `@svgr/webpack` will always export the React component via named export.
81
+
82
+
If you prefer named export in any case, you may set the `exportType` option to `named`.
83
+
80
84
### Use your own Babel configuration
81
85
82
86
By default, `@svgr/webpack` includes a `babel-loader` with [an optimized configuration](https://github.com/gregberge/svgr/blob/master/packages/webpack/src/index.js). In some case you may want to apply a custom one (if you are using Preact for an example). You can turn off Babel transformation by specifying `babel: false` in options.
Copy file name to clipboardExpand all lines: website/src/pages/docs/rollup.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,10 @@ const App = () => (
75
75
76
76
The named export defaults to `ReactComponent`, but can be customized with the `namedExport` option.
77
77
78
+
Please note that by default, `@svgr/rollup` will try to export the React Component via default export if there is no other plugin handling svg files with default export. When there is already any other plugin using default export for svg files, `@svgr/rollup` will always export the React component via named export.
79
+
80
+
If you prefer named export in any case, you may set the `exportType` option to `named`.
81
+
78
82
### Use your own Babel configuration
79
83
80
84
By default, `@svgr/rollup` applies a babel transformation with [optimized configuration](https://github.com/gregberge/svgr/blob/master/packages/rollup/src/index.js). In some case you may want to apply a custom one (if you are using Preact for an example). You can turn off Babel transformation by specifying `babel: false` in options.
0 commit comments