Is there any way to configure the options of svgo on middleman-imageoptim?
Example: I want to keep IDs of the SVG symbols.
Thanks!
Is there any way to configure the options of svgo on middleman-imageoptim?
Example: I want to keep IDs of the SVG symbols.
Thanks!
Middleman ImageOptim just invokes image_optim, which in turn invokes SVGO. This means that the options must be handed off in three places:
From you to Middleman ImageOptim:
This part is ready to go, e.g.:
activate :imageoptim do |options|
options.svgo = { disable: ['cleanupIDs'] }
end
From Middleman ImageOptim to image_optim:
The chain breaks here, as image_optim doesn’t yet offer any options for configuring SVGO.
From image_optim to SVGO:
Right now image_optim always runs SVGO with the same two command-line arguments, but it doesn’t have to. SVGO offers a way to disable individual plugins, e.g.:
svgo --disable cleanupIDs --input $src --output $dst
So it should just be a matter of teaching image_optim how to configure SVGO.
I’d recommend opening a polite issue to ask about this, and be sure to reference toy/image_optim#30 so that the author of image_optim’s support for SVGO has a chance to provide input.