airbnb / airbnb/babel-plugin-inline-react-svg

Svg file path is not passed to svgo

Open
#109 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
474
Forks
90
PR merge metrics
No merged PRs in 30d

Description

Svgo has an option to pass the path to svg file to the `optimize` function https://github.com/svg/svgo#optimize

It allows the `prefixIds` plugin to automatically prefix ids with a file name https://github.com/svg/svgo/blob/master/plugins/prefixIds.js#L194

However it seems like in this plugin the path is not passed to svgo `optimize` https://github.com/airbnb/babel-plugin-inline-react-svg/blob/master/src/index.js#L74, and because of that, no path data is available for the `prefixIds` plugin.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open src/index.js at the optimize call around line 74 and compare it with SVGO's documented optimize options. Pass the SVG file path so the prefixIds plugin can receive path data and prefix IDs using the filename; confirm the resulting optimized SVG includes the expected prefixes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.