Gathering detailed insights and metrics for @svgr/rollup
Gathering detailed insights and metrics for @svgr/rollup
Gathering detailed insights and metrics for @svgr/rollup
Gathering detailed insights and metrics for @svgr/rollup
npm install @svgr/rollup
Typescript
Module System
Min. Node Version
Node Version
NPM Version
82.7
Supply Chain
75.7
Quality
75
Maintenance
100
Vulnerability
98.9
License
TypeScript (64.93%)
MDX (20.67%)
JavaScript (14.4%)
Total Downloads
46,575,050
Last Day
16,752
Last Week
387,861
Last Month
1,651,304
Last Year
14,820,086
MIT License
10,840 Stars
650 Commits
430 Forks
35 Watchers
3 Branches
129 Contributors
Updated on Jul 02, 2025
Minified
Minified + Gzipped
Latest Version
8.1.0
Package Id
@svgr/rollup@8.1.0
Unpacked Size
13.16 kB
Size
4.74 kB
File Count
6
NPM Version
lerna/6.6.0/node@v18.17.0+arm64 (darwin)
Node Version
18.17.0
Published on
Aug 15, 2023
Cumulative downloads
Total Downloads
Last Day
-15.7%
16,752
Compared to previous day
Last Week
-7.3%
387,861
Compared to previous week
Last Month
9%
1,651,304
Compared to previous month
Last Year
27.9%
14,820,086
Compared to previous year
Rollup plugin for SVGR.
npm install @svgr/rollup --save-dev
In your rollup.config.js
:
1{ 2 plugins: [svgr()] 3}
In your code:
1import Star from './star.svg' 2 3const App = () => ( 4 <div> 5 <Star /> 6 </div> 7)
1{ 2 plugins: [svgr({ native: true })] 3}
url
pluginIt is possible to use it with url
.
In your rollup.config.js
:
1{ 2 plugins: [url(), svgr()] 3}
In your code:
1import starUrl, { ReactComponent as Star } from './star.svg' 2 3const App = () => ( 4 <div> 5 <img src={starUrl} alt="star" /> 6 <Star /> 7 </div> 8)
The named export defaults to ReactComponent
, but can be customized with the namedExport
option.
Please note that by default, @svgr/rollup
will try to export the React Component via default export if there is no other plugin handling svg files with default export. When there is already any other plugin using default export for svg files, @svgr/rollup
will always export the React component via named export.
If you prefer named export in any case, you may set the exportType
option to named
.
By default, @svgr/rollup
applies a babel transformation with optimized configuration. In some case you may want to apply a custom one (if you are using Preact for an example). You can turn off Babel transformation by specifying babel: false
in options.
1{ 2 plugins: [svgr({ babel: false })] 3}
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 18/28 approved changesets -- score normalized to 6
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
81 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More