Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@nodejs-loaders/svgx

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nodejs-loaders/svgx

Extend node to support SVG as JSX via customization hooks.

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
2
Created
Source

Nodejs Loaders: SVGX

@node.js loaders logo

npm version unpacked size compatible node version(s)

Usage

$ npm i -D @nodejs-loaders/svgx
$ node --import @nodejs-loaders/svgx main.js

See README.md in the repository's root for more details.

Environment: test

Compatible APIs:

This loader facilitates running tests against JSX/TSX components that consume SVGs as JSX/TSX. It looks for a esbuild.config.mjs in the project root (the current working directory); if your config lives in a different location, create a symlink to it from your project root. Only options for esbuild's "transform" API are valid (esbuild handles looking for a tsconfig). When none is found, it uses a few necessary default.

If your project contains legacy specifiers (eg without a file extension), use the `correct-ts-specifiers`` codemod to fix your source-code.

This loader depends on @nodejs-loaders/text and @nodejs-loaders/tsx, which must be registered after it, like:

module.register(`@nodejs-loaders/svgx`);
module.register(`@nodejs-loaders/text`);
module.register(`@nodejs-loaders/tsx`);
Supported file extensions
  • .svg

Keywords

customization hooks

FAQs

Package last updated on 15 Mar 2026

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