Skip to content
This repository has been archived by the owner on May 3, 2019. It is now read-only.

Allow optional custom svgmin plugins #2

Merged
merged 2 commits into from
Feb 18, 2016
Merged

Allow optional custom svgmin plugins #2

merged 2 commits into from
Feb 18, 2016

Conversation

tannerhodges
Copy link
Contributor

Got another custom option to add for svgmin plugins.

Realized that my build needed some different options, so I just tacked on another argument:

mix.svgstore('resources/assets/icons/global', 'public/sprites/', 'global.svg', [
  { removeUnknownsAndDefaults: false },
  { removeUselessStrokeAndFill: false },
  { collapseGroups: false }
]);

When left blank, it uses the original default plugins you had set.

Ideally, I'd clean this up a bit by using the Elixir config to handle settings like this. But for now, this gets the job done.

Oh, and in case anybody wanted to set custom plugins but still use the default source/output/filename, you can just pass null for those first couple of arguments. Like so:

mix.svgstore(null, null, null, [
  { removeUnknownsAndDefaults: false },
  { removeUselessStrokeAndFill: false },
  { collapseGroups: false }
]);

Again, this could be cleaned up but wanted to get this first pass in.

@sknoslo
Copy link
Owner

sknoslo commented Feb 17, 2016

Sorry for the delay on this. This will be a very useful feature. I think the defaults are useful though... so could you perhaps update the README to document what the default options are set to?

That way users wont accidentally override the defaults when they didn't mean to.

I'll happily accept this PR when that is done. Thanks!

@tannerhodges
Copy link
Contributor Author

@sknoslo No worries. Added a note to the "By default..." section of the readme. How's that look?

@sknoslo
Copy link
Owner

sknoslo commented Feb 18, 2016

Looks good to me. Thanks!

sknoslo added a commit that referenced this pull request Feb 18, 2016
Allow optional custom svgmin plugins
@sknoslo sknoslo merged commit 762bd36 into sknoslo:master Feb 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants