๐ฆ plugin-svgr
An SVGR plugin to transform SVG files into React components automatically at build time.
Installationโ
- npm
- Yarn
- pnpm
npm install --save @docusaurus/plugin-svgr
yarn add @docusaurus/plugin-svgr
pnpm 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.
Configurationโ
์ค์ ํ ์ ์๋ ํ๋
์ต์ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช |
---|---|---|---|
svgrConfig | object | {} | The SVGR config options, forwarded as is |
Example configurationโ
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 */
},
},
],
],
};