Skip to content

Commit 6450ec0

Browse files
cedric07cursoragent
andcommitted
fix(build): restrict production SVGO minimizer to SVG files
Sharp already skips SVGs; without a matching filter, svgoMinify ran on raster assets and could fail or corrupt them during production builds. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1cfba36 commit 6450ec0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎config/webpack.common.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module.exports = {
4444
},
4545
{
4646
implementation: ImageMinimizerPlugin.svgoMinify,
47+
filter: (source, sourcePath) => /\.svg$/i.test(sourcePath),
4748
options: {
4849
encodeOptions: {
4950
multipass: true,

0 commit comments

Comments
 (0)