esbuild-svg 1.0.3 is an esbuild plugin that transforms SVG files into JSX React components using SVGR under the hood. It supports both default and named exports, configurable SVGO optimization, and provides a publicPath feature via a special import suffix. Currently stable, it releases occasionally. Compared to alternatives like @svgr/webpack or vite-plugin-svgr, it is tailored specifically for esbuild and integrates tightly with its publicPath configuration. It ships TypeScript definitions and requires React (peer dependency) for JSX rendering.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Package ships both ESM and CJS. Default import works in both, but require() may have issues if the package is used in ESM context.
Named export 'ReactComponent' is used when SVGR config has exportType: 'named' (default). Wrong default import will result in undefined.
Appending '?' to the import path returns the SVG's public URL string instead of a component. Omitting '?' returns the component.
Configures esbuild with the SVG plugin to transform SVG imports into React components using default SVGR settings.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.