An esbuild plugin that transforms SVG imports into React components using SVGR, with built-in file-type filtering to avoid breaking non-React imports (e.g., CSS url() references). Version 0.2.0 requires esbuild ^0.14.0 and TypeScript types are included. Unlike alternatives, it defaults to processing only .js/.ts/.tjx/.tsx files to prevent loader conflicts, and allows custom filter/issuer regexes. Suitable for React projects bundled via esbuild. Release cadence is low; install via npm or yarn.
npm install esbuild-svgr-pluginVerified import paths — ran on the pinned version, not inferred.
Bundles a React application, transforming SVG imports into React components via SVGR plugin.
Update esbuild to ^0.14.0 or later.
If you need SVG transformation inside CSS, adjust filter and issuer accordingly, but be aware of potential loader errors.
Monitor SVGR releases and update this plugin if necessary.
Ensure the filter regex includes .svg (default does) and the importing file matches issuer (default: .js/.ts/.tjx/.tsx). Check your esbuild plugins order.
Use `import { svgrPlugin } from 'esbuild-svgr-plugin'`.