Skip to content

svgo example in the readme is no longer valid #103

Description

@return42

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'
 ],
};

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions