Socket
Socket
Sign inDemoInstall

@svgr/plugin-svgo

Package Overview
Dependencies
100
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @svgr/plugin-svgo

Optimize SVG


Version published
Weekly downloads
6.6M
decreased by-1.31%
Maintainers
1
Install size
7.12 MB
Created
Weekly downloads
 

Package description

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

Readme

Source

@svgr/plugin-svgo

Build Status Version MIT License

Optimize SVG using SVGO.

Install

npm install --save-dev @svgr/plugin-svgo

Usage

.svgrrc

{
  "plugins": ["@svgr/plugin-svgo"]
}

License

MIT

Keywords

FAQs

Last updated on 15 Aug 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc