Error: Invalid configuration: plugins must be an array – cleanupIDs plugin behavior across files
0 reputation · 06 Apr 2025, 06:36 UTC
Goal
Clarify the behavior of the cleanupIDs plugin when processing SVG files that share identical ID attributes referenced via <use> elements across multiple files, while the plugins option is correctly defined as an array.
Constraints
Using svgo v2.x, a configuration file with plugins: ['cleanupIDs'] is considered valid. The SVG input contains duplicate ID values that are referenced by <use> elements in separate files. The plugin is expected to rename or remove IDs to avoid conflicts, but the documentation does not specify cross-file handling.
Unresolved Decision
It remains unclear whether cleanupIDs will rename an ID that is referenced by a <use> element in another SVG file, potentially breaking the reference, or preserve it to maintain consistency.
Questions
1. Does cleanupIDs rename IDs that are referenced by <use> elements in separate SVG files?
2. If renaming occurs, how can a developer preserve the original reference without manual post-processing?
3. Is there a configuration flag or a version difference that dictates this behavior?