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

@tabula/svgr-config

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tabula/svgr-config

Configuration for the SVGR with ability to change name and display name of components

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

@tabula/svgr-config

Configuration for the SVGR which extends default behaviour:

  • forces memoization;
  • allows to rename exported name;
  • adds display name for memoized component.

It developed to use with @tabula/forge package, but you can use it on your own risks with your vanilla configuration.

Installation

Use the package manager pnpm to install @tabula/svgr-config.

pnpm add @tabula/svgr-config --save-dev

You can use npm or yarn too.

Usage

Add the .svgrrc.js file to the root:

import { defineConfig } from '@tabula/svgr-config';

export default defineConfig({
  scope: 'my-awesome-scope',

  transformName(name) {
    return `Ui${name.slice(3)}`;
  },
});

For example, you have comma.svg filename, and apply SVGR to it. Results will be following with configuration from above example:

  • name of component will be UiComma instead of SvgComma;
  • display name of memoized component will be my-awesome-scope(UiComma).

Scoping are helpful in combination with React Dev Tools.

License

This project is ISC licensed.

Keywords

FAQs

Package last updated on 23 Jul 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