Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/transformer-svg

Package Overview
Dependencies
Maintainers
1
Versions
528
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/transformer-svg

  • 2.12.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @parcel/transformer-svg?

@parcel/transformer-svg is a plugin for Parcel, a web application bundler. This transformer allows you to import SVG files and use them in your JavaScript, CSS, or HTML files. It can optimize SVG files, inline them, or convert them to React components.

What are @parcel/transformer-svg's main functionalities?

Importing SVG as URL

This feature allows you to import an SVG file as a URL, which can then be used in your HTML or CSS.

import logoUrl from './logo.svg';
console.log(logoUrl);

Inlining SVG

This feature allows you to import an SVG file and inline its content directly into your HTML.

import logo from './logo.svg';
document.body.innerHTML = logo;

Converting SVG to React Component

This feature allows you to import an SVG file as a React component, which can then be used in your React application.

import { ReactComponent as Logo } from './logo.svg';
function App() {
  return <Logo />;
}

Other packages similar to @parcel/transformer-svg

FAQs

Package last updated on 28 Feb 2024

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc