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

svgo example in the readme is no longer valid #103

Open
return42 opened this issue Nov 14, 2021 · 0 comments
Open

svgo example in the readme is no longer valid #103

return42 opened this issue Nov 14, 2021 · 0 comments

Comments

@return42
Copy link

return42 commented Nov 14, 2021

The svgo example in the readme ...

options: {
  svgo: ['--enable', 'cleanupIDs', '--disable', 'convertColors']
}

... is no longer valid. To configure svgo a config file is needed.

By example, for others who struggle with. Here is what I have done to optimize my SVG for the WEB usage:

Set --config option in the grunt-image options ...

options: {
    svgo: ['--config', 'svg4web.svgo.js']
},

.. and create a config file : svg4web.svgo.js

module.exports = {
  plugins: [
    {
      name: 'preset-default',
    },
    // make diff friendly
    'sortAttrs',
    // Optimize SVG for WEB usage
    'convertStyleToAttrs',
    'removeXMLNS'
 ],
};
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

1 participant