A Babel plugin (v2.0.2) that transforms SVG file imports into inline React components, using SVGO for optimization. Stable but infrequently updated (last release ~2019). Alternatives like @svgr/webpack are more actively maintained and support broader use cases. Requires @babel/core ^7.0.0 as a peer dependency. Works in Node.js >=10.13, not browser-native.
npm install babel-plugin-inline-react-svgNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup and usage: configuring the plugin in .babelrc and importing an SVG as a React component.
If you relied on earlier behavior, configure svgo options explicitly to disable unwanted plugins.
Use the 'plugins' array directly; see SVGO documentation for v2 configuration.
Set caseSensitive: true in plugin options to enforce case sensitivity on all platforms.
Upgrade to Babel 7 or use version 1.x of the plugin.
npm install --save-dev babel-plugin-inline-react-svg
Use import or const plugin = require('babel-plugin-inline-react-svg').default;