Rollup plugin that converts SVG files into React components using SVGR, without SVGO optimization or Babel transformation. Version 4.0.1 runs on Node >=20.9.0. Regularly updated with semver releases. Unlike other SVGR integrations, this plugin intentionally omits SVGO and Babel, reducing bundle size and build complexity for projects that handle optimization elsewhere. It supports a custom transform option instead of the removed babel option.
npm install rollup-plugin-svgrVerified import paths — ran on the pinned version, not inferred.
Shows basic setup of rollup-plugin-svgr with include/exclude, SVGR options, and custom transform function.
Replace babel option with a transform function: transform(code, id) { ... }No direct action needed; if you rely on synchronous behavior, upgrade to asynchronous flow.
Upgrade to Node >=20.9.0
Upgrade to Node >=18
Use separate SVGO rollup plugin if optimization needed, or implement custom transform.
Replace babel with transform option: svgr({ transform(code, id) { ... } })Use import svgr from 'rollup-plugin-svgr' or const svgr = require('rollup-plugin-svgr').defaultUpgrade Node.js to >=20.9.0 or use an older version of the plugin (e.g., 2.x for Node 16).