Skip to content

Commit

Permalink
docs(plugin-svgr): explain base64 URL (#4168)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Dec 10, 2024
1 parent 464fdd7 commit 696899f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion website/docs/en/plugins/list/plugin-svgr.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import Logo from './logo.svg?react';
export const App = () => <Logo />;
```

If the imported path does not contain the `?react` suffix, then the SVG will be treated as a normal static asset and you will get a URL:
If the imported path does not contain the `?react` suffix, then the SVG will be treated as a normal static asset and you will get a URL string or base64 URL, see [Import Static Assets](/guide/basic/static-assets).

```js
import logoURL from './static/logo.svg';
Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/plugins/list/plugin-svgr.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import Logo from './logo.svg?react';
export const App = () => <Logo />;
```

如果导入的路径不包含 `?react` 后缀,那么 SVG 会被当做普通的静态资源来处理,你会得到一个 URL 字符串:
如果导入的路径不包含 `?react` 后缀,那么 SVG 会被当做普通的静态资源来处理,你会得到一个 URL 字符串或 base64 URL,参考 [引用静态资源](/guide/basic/static-assets)

```js
import logoURL from './static/logo.svg';
Expand Down

0 comments on commit 696899f

Please sign in to comment.