Skip to content

Export the baseline SVGO config so custom configs can extend it - #22

Merged
evoactivity merged 1 commit into
mainfrom
feat/export-baseline-svgo-config
Oct 26, 2026
Merged

evoactivity merged 1 commit into
mainfrom
feat/export-baseline-svgo-config

Conversation

@evoactivity

Copy link
Copy Markdown
Contributor

A custom svgo config replaces the baseline config. The README options and the SvgJarOptions comment said it was deep-merged, which was wrong.

What changed

  • baselineSvgoConfig is exported from @svg-jar/plugin. To keep the baseline and add plugins, copy its plugins into a custom config:

    import { baselineSvgoConfig } from '@svg-jar/plugin';
    
    svgJar({ svgo: { plugins: [...baselineSvgoConfig.plugins, 'removeDimensions'] } });
  • The export is frozen, and its plugins list is typed as read-only, so one caller cannot change the default for every build.

  • The README and SvgJarOptions docs now say a custom config replaces the baseline. The README also explains why a config written without the baseline should keep the cleanupIds override, because shortened IDs from different files can collide in one sprite sheet.

The baseline is not merged automatically. With a merge, users could not remove baseline plugins, and changing a baseline setting would run preset-default twice.

Tests

Unit tests check that the export matches the svgo: true behaviour, that it can be extended, that it cannot be changed, and that a custom config is used without the baseline.

🤖 Generated with Claude Code

A custom svgo config replaces the baseline config, but the README and the
SvgJarOptions comment said it was deep-merged. Export baselineSvgoConfig
so users can extend the baseline by copying its plugins, and correct the
docs. The export is frozen so one caller cannot change the default for
every build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@evoactivity evoactivity added the enhancement New feature or request label Oct 26, 2026
@evoactivity
evoactivity merged commit 0d3505b into main Oct 26, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant