You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@svgr/plugin-svgo

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@svgr/plugin-svgo

Optimize SVG

8.1.0
latest
Source
npmnpm
Version published
Weekly downloads
8.9M
0.6%
Maintainers
1
Weekly downloads
 
Created

What is @svgr/plugin-svgo?

The @svgr/plugin-svgo package is a plugin for SVGR that allows you to optimize SVG files using SVGO during the transformation of SVGs into React components. This optimization can include removing unnecessary attributes, minifying the file, and more, which can result in smaller and more efficient SVG components for use in web applications.

What are @svgr/plugin-svgo's main functionalities?

Optimize SVGs during conversion to React components

This feature allows you to optimize SVG files using SVGO while converting them into React components. The code sample demonstrates how to use the SVGR core library with the SVGO plugin to optimize an SVG string.

import svgr from '@svgr/core';
import svgoPlugin from '@svgr/plugin-svgo';

const svgCode = '<svg>...</svg>';
const optimizedComponent = svgr(svgCode, { plugins: [svgoPlugin()] });
console.log(optimizedComponent);

Other packages similar to @svgr/plugin-svgo

Keywords

svgr-plugin

FAQs

Package last updated on 15 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts