Closed jimblue closed 3 years ago
Thanks for the heads-up. This is an interesting change, to say the least... They overhauled the entire defaults setup and deprecated the old one while the new one is not compatible at all so now this plugin has to support both systems.
The changes in 500280a should handle this, all tests are passing with both SVGO 2.3.0 and 2.4.0. Are you able to verify this on your end as well?
Hey @cascornelissen, thank you for the commit, I'll try to test that tomorrow.
@jimblue (or anyone else running into this problem), had any time to verify it already?
Have the same issue
Was getting the same warning as OP so I tested it with 500280acbf4517319e57e951a44db524060dc105 and while the issue is fixed - no warnings are logged - the output spritemap changed unfortunately.
I assume the issue is that we use the removeAttrs
plugin, which isn't part of the default preset and the override plugin only works for plugins that are included in the preset.
So maybe it should be developer's responsibility to use the default-preset plugin if they want to use the default plugins and they'll be able to completely override plugins otherwise. But I understand that injecting the "pre" and "post" plugins will become little bit trickier.
@meelkor, thanks for testing 500280a out and reporting your findings.
Can you share your configuration so that I can check what's happening? An update to SVGO can always change the output of the spritemap and it's not entirely clear to me whether the problem you're describing is about having a different output or the removeAttrs
plugin not doing what you're expecting it to do.
As you've probably figured out we can't exclude the default-preset plugin from this project as there's overwrites that need to be made in certain scenarios.
If anyone has the same issue, please try out the current master
directly from GitHub and let me know if that resolves the issue. If you're seeing new issues feel free to keep them in this thread for now.
npm install cascornelissen/svg-spritemap-webpack-plugin#master
hello below is the config, the sprite is working fine but the "preset-default" warning remains.
new SVGspritemapPlugin(`${resourcesDir}/img/**/*.svg`, {
output: {
filename: 'img/icons.svg',
chunk: { keep: true },
svgo: {
plugins: [
{
name: 'removeAttrs',
params: {
attrs: '(fill)'
}
}
]
}
},
sprite: {
prefix: 'icon-'
}
})
@zavod008 are you talking about the "extendDefaultPlugins" utility is deprecated.
warning as listed in the original post? Are you on the master build or did you install the plugin from NPM? Please read the last part of https://github.com/cascornelissen/svg-spritemap-webpack-plugin/issues/175#issuecomment-904906685.
@cascornelissen 1) yes "extendDefaultPlugins" utility is deprecated. 2) from npm. ok i try install master version
@cascornelissen The master build can solve this issue for me. https://github.com/cascornelissen/svg-spritemap-webpack-plugin/issues/175#issuecomment-904906685
Thanks for reporting back @sectsect, this change was released with version 4.3.0
🚀 If there's any issues popping up feel free to create a new ticket.
Description This plugin stopped working in project using latest SVGO release 2.4.0
Expected behavior This should work with latest SVGO update as SVGO is a peer dependency of many projects.
Actual behavior When running webpack :
System information