📦 plugin-svgr
An SVGR plugin to transform SVG files into React components automatically at build time.
설치
- npm
- Yarn
- pnpm
- Bun
npm install --save @docusaurus/plugin-svgr
yarn add @docusaurus/plugin-svgr
pnpm add @docusaurus/plugin-svgr
bun add @docusaurus/plugin-svgr
팁
If you use the preset @docusaurus/preset-classic, you don't need to install this plugin as a dependency.
You can configure this plugin through the preset options.
설정
설정할 수 있는 필드
| 옵션명 | 타입 | 기본값 | 설명 |
|---|---|---|---|
svgrConfig | object | {} | The SVGR config options, forwarded as is |
설정 예시
You can configure this plugin through plugin options.
- 프리셋 옵션
- 플러그인 옵션
프리셋을 사용하는 경우 프리셋 옵션를 통해 플러그인을 구성합니다.
docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
svgr: {
svgrConfig: {
/* SVGR config */
},
},
},
],
],
};
독립적으로 실행되는 플러그인을 사용하는 경우에는 플러그인에 대한 옵션을 직접 설정할 수 있습니다.
docusaurus.config.js
module.exports = {
plugins: [
[
'@docusaurus/plugin-svgr',
{
svgrConfig: {
/* SVGR config */
},
},
],
],
};