svgo.optimize accepts a second parameter, which is passed to plugins. rollup-plugin-svgo currently doesn't pass this parameter, which breaks svgo opts that are expecting it.
For example, consider this usage of the prefixIds plugin:
This configuration prefixes IDs to avoid collisions when multiple SVG files are processed to be displayed at the same time. The configuration provided works with the webpack svgo loader because they pass the filename. It breaks with rollup-plugin-svgo.
This PR brings rollup-plugin-svgo into parity with the webpack loader and prevents breakage when plugins/configurations expect this information to be present.
svgo.optimize accepts a second parameter, which is passed to plugins. rollup-plugin-svgo currently doesn't pass this parameter, which breaks svgo opts that are expecting it.
For example, consider this usage of the prefixIds plugin:
This configuration prefixes IDs to avoid collisions when multiple SVG files are processed to be displayed at the same time. The configuration provided works with the webpack svgo loader because they pass the filename. It breaks with rollup-plugin-svgo.
This PR brings rollup-plugin-svgo into parity with the webpack loader and prevents breakage when plugins/configurations expect this information to be present.