Skip to content

Commit e24c9ee

Browse files
SoonIterTimeless0911
authored andcommitted
chore: update
1 parent d32c30f commit e24c9ee

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

website/docs/en/guide/advanced/svgr-files.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
By default, Rslib treats SVG images as static assets.
44

5-
By adding the [@rsbuild/plugin-svgr](https://rsbuild.dev/en/plugins/list/plugin-svgr) plugin, Rslib supports invoking [SVGR](https://react-svgr.com/) to convert SVG images into React components for use.
5+
By adding the [@rsbuild/plugin-svgr](https://rsbuild.dev/plugins/list/plugin-svgr) plugin, Rslib supports invoking [SVGR](https://react-svgr.com/) to convert SVG images into React components for use.
66

77
## Quick Start
88

@@ -30,7 +30,7 @@ export default {
3030

3131
### Bundle Mode
3232

33-
In Bundle mode, all usages supported by the [Rsbuild SVGR plugin](https://rsbuild.dev/en/plugins/list/plugin-svgr) are available. The only difference is that when using an SVG file in URL form, Rslib will retain the `import` statement for the static asset in the output according to [Referencing Static Assets](/en/guide/advanced/static-assets).
33+
In Bundle mode, all usages supported by the [Rsbuild SVGR plugin](https://rsbuild.dev/plugins/list/plugin-svgr) are available. The only difference is that when using an SVG file in URL form, Rslib will retain the `import` statement for the static asset in the output according to [Referencing Static Assets](/guide/advanced/static-assets).
3434

3535
Here is an example of usage:
3636

@@ -52,16 +52,16 @@ console.log(logoURL);
5252

5353
`@rsbuild/plugin-svgr` also supports default imports and mixed imports:
5454

55-
- Enable default imports by setting [svgrOptions.exportType](https://rsbuild.dev/en/plugins/list/plugin-svgr#svgroptionsexporttype) to `'default'`.
56-
- Enable mixed imports through the [mixedImport](https://rsbuild.dev/en/plugins/list/plugin-svgr#mixedimport) option to use both default and named imports.
55+
- Enable default imports by setting [svgrOptions.exportType](https://rsbuild.dev/plugins/list/plugin-svgr#svgroptionsexporttype) to `'default'`.
56+
- Enable mixed imports through the [mixedImport](https://rsbuild.dev/plugins/list/plugin-svgr#mixedimport) option to use both default and named imports.
5757

5858
### Bundleless Mode
5959

6060
In Bundleless mode, since each file undergoes code transformation independently, the import ways of `?react` and `?url` are not supported. However, the following two usage forms are supported:
6161

6262
#### Named Import
6363

64-
`@rsbuild/plugin-svgr` supports named import of `ReactComponent` to use SVGR. You need to set [svgrOptions.exportType](https://rsbuild.dev/en/plugins/list/plugin-svgr#svgroptionsexporttype) to `'named'`.
64+
`@rsbuild/plugin-svgr` supports named import of `ReactComponent` to use SVGR. You need to set [svgrOptions.exportType](https://rsbuild.dev/plugins/list/plugin-svgr#svgroptionsexporttype) to `'named'`.
6565

6666
```js
6767
pluginSvgr({
@@ -79,8 +79,8 @@ export const App = () => <Logo />;
7979

8080
All `.svg` files will be converted into React components. At this time, you can:
8181

82-
- Exclude files that do not need to be converted by setting [exclude](https://rsbuild.dev/en/plugins/list/plugin-svgr#exclude).
83-
- Change to default export by setting [svgrOptions.exportType](https://rsbuild.dev/en/plugins/list/plugin-svgr#svgroptionsexporttype) to `'default'`.
82+
- Exclude files that do not need to be converted by setting [exclude](https://rsbuild.dev/plugins/list/plugin-svgr#exclude).
83+
- Change to default export by setting [svgrOptions.exportType](https://rsbuild.dev/plugins/list/plugin-svgr#svgroptionsexporttype) to `'default'`.
8484

8585
#### Mixed Import
8686

@@ -104,4 +104,4 @@ console.log(logoUrl); // -> string
104104
console.log(Logo); // -> React component
105105
```
106106

107-
For more information, refer to the [mixedImport](https://rsbuild.dev/en/plugins/list/plugin-svgr#mixedimport) option.
107+
For more information, refer to the [mixedImport](https://rsbuild.dev/plugins/list/plugin-svgr#mixedimport) option.

0 commit comments

Comments
 (0)