Skip to content

v4.0.0

Choose a tag to compare

@github-actions github-actions released this 17 Aug 20:48
· 242 commits to main since this release
5c09014

Full Changelog: v3.0.1...v4.0.0

Make sure to read the Configuration changes section below to make sure your configuration is up-to-date.

The optimize option, which included SVGO in this plugin, has been dropped in favor of the icon.transform function which can do any transformation (including optimizing!) on the raw icon. This also reduced the bundle size by ~60-75%! Yay! I also did a mini rewrite of the core plugin structure; errors messages are a little more detailed (and more colorful!), arbitrary requirements like forcing a .svg extension for the generateFile option have been removed, etc.

Configuration changes

New: 🟢
Changed: 🔶
Removed: 🟥

  • 🔶 sources: is now an array of source objects, which has the added benefit of the ability to add additional options for each source down the road. Each source has two required properties, name and path, and an optional default property (maximum one source can be the default).
  • 🟥 default: removed in favor of the default property of a source in sources (see ^^^)
  • 🟥 optimize: dropped in favor of the icon.transform function
  • 🟥 SVGO: no longer needed without optimize
  • 🔶 sprites: renamed to sprite
  • 🔶 sprites.insertAttributes: renamed to sprite.attributes
  • 🟢 icon.transform: transform the raw content of each icon directly!
  • 🔶 icon.insertAttributes: renamed to icon.attributes
  • 🔶 icon.insertAttributesBySource: renamed to icon.attributesBySource
  • 🟢 icon.errorNotFound: throw an error when an icon is not found (default: true)
  • 🟥 icon.ignoreNotFound: dropped in favor of errorNotFound (see ^^^)
  • 🔶 sprites.generateFile: renamed to sprite.writeFile, no longer accepts true (no default path). Set to a path string or false.
  • 🟢 sprite.extraIcons: { all: false, sources: [], icons: [] } - all takes the place of sprites.insertAll, sources is a new array of source names to include all icons from, icons takes an array of { name: '', source: '' } icon objects to include.
  • 🟥 sprites.insertAll: dropped in favor of sprite.extraIcons (see ^^^)