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

Enable svgo removeXMLNS plugin by default #9

Open
lencioni opened this issue Mar 21, 2017 · 7 comments
Open

Enable svgo removeXMLNS plugin by default #9

lencioni opened this issue Mar 21, 2017 · 7 comments

Comments

@lencioni
Copy link
Contributor

This plugin removes the xmlns attribute from the top-level svg element, which is safe for inline SVGs, which is how all SVGs transformed by this plugin will end up being used. I think it makes sense to enable this plugin by default.

https://github.com/svg/svgo/blob/master/plugins/removeXMLNS.js

@kesne
Copy link
Collaborator

kesne commented Mar 21, 2017

While it's safe, I think I'd prefer no-plugins by default, and allow people to opt-in to plugins they want.

@lencioni
Copy link
Contributor Author

How come? svgo has a lot of plugins enabled by default, and this proposal simply extends that to also include a plugin that is guaranteed to always be applicable in this situation.

@kesne
Copy link
Collaborator

kesne commented Mar 21, 2017

I just personally prefer having it be a cleaner zero-opinion pass-through to SVGO.

@kesne
Copy link
Collaborator

kesne commented Jun 20, 2017

I've changed my mind on this, I think having sane defaults included in the plugin would be great.

@emartini
Copy link

Sounds great!, I've added manually all the svgo default plugins and my .babelrc looks more like a svgo config file

@lencioni
Copy link
Contributor Author

@emartini can you share your configuration here?

@emartini
Copy link

["inline-react-svg", {
      "svgo": {
        "plugins": [
          { "cleanupAttrs": true },
          { "removeDoctype": true },
          { "removeXMLProcInst": true },
          { "removeComments": true },
          { "removeMetadata": true },
          { "removeDesc": true },
          { "removeUselessDefs": true },
          { "removeEditorsNSData": true },
          { "removeEmptyAttrs": true },
          { "removeHiddenElems": true },
          { "removeEmptyText": true },
          { "removeEmptyContainers": true },
          { "cleanupEnableBackground": true },
          { "minifyStyles": true },
          { "convertStyleToAttrs": true },
          { "convertColors": true },
          { "convertPathData": true },
          { "convertTransform": true },
          { "removeUnknownsAndDefaults": true },
          { "removeNonInheritableGroupAttrs": true },
          { "removeUselessStrokeAndFill": true },
          { "removeUnusedNS": true },
          { "cleanupIDs": true },
          { "cleanupNumericValues": true },
          { "cleanupListOfValues": true },
          { "moveElemsAttrsToGroup": true },
          { "moveGroupAttrsToElems": true },
          { "collapseGroups": true },
          { "mergePaths": true },
          { "convertShapeToPath": true },
          { "removeXMLNS": true },
        ]
      }
    }]

The only non default option is removeXMLNS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants