Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: What determines the execution order of plugins #589

Closed
elidupuis opened this issue Sep 1, 2016 · 2 comments
Closed

Question: What determines the execution order of plugins #589

elidupuis opened this issue Sep 1, 2016 · 2 comments

Comments

@elidupuis
Copy link
Contributor

Just curious if there's any way to control the execution order of plugins... I ran into a conflict where one plugin was trying target elements by id but the removeAttrs plugin had already been run—and it was configured to remove the id attribute! Obviously, the order the plugins are executed would make a difference in this case...

@GreLI
Copy link
Member

GreLI commented Sep 2, 2016

Plugins are being run in order they're defined in config. By default it's defined in .svgo.yml.

@elidupuis
Copy link
Contributor Author

Thanks for clarifying, @GreLI. Turns out that my issue was actually the cleanupIDs plugin running before the removeElementsByAttr—which I had configured to remove an element by ID but by that time the ID had already been removed.

Easy fix was to explicitly declare the cleanupIDs plugin in my config after the removeElementsByAttr plugin.

I wonder if it's worth giving removeElementsByAttr a little more priority in the order of execution... Seems like there could definitely be conflicts with cleanupAttrs and cleanupIDs.

@GreLI GreLI closed this as completed Nov 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants