Skip to content

Commit 07419a0

Browse files
cedric07cursoragent
andcommitted
fix(build): skip SVGO for icons/ asset paths
Match webpack extract names like icons/sprite.svg so prod minify does not empty sprite sheets. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent b518ada commit 07419a0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎config/webpack.common.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ module.exports = {
4949
return false
5050
}
5151

52-
// svg-sprite-loader extract: dist/icons/{sprite}.svg — prod SVGO breaks <symbol> entries.
53-
if (/[/\\]icons[/\\][^/\\]+\.svg$/i.test(sourcePath)) {
52+
// svg-sprite-loader extract publicPath is `icons/` — prod SVGO
53+
// removes unused <symbol> entries and empties sprite sheets.
54+
if (/(?:^|[/\\])icons[/\\]/i.test(sourcePath)) {
5455
return false
5556
}
5657

0 commit comments

Comments
 (0)