You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using imagemin-cli in order to keep things simple and lightweight. But imagemin-cli doesn't allow you to pass options to its underlying compression tools, so its version of SVGO will always strip classes and IDs for you, even if they're important to something you're planning on doing with said SVG....
Maybe we should handle SVGs differently so we can run them through SVGO on our own? It's a slight bummer to include an essentially duplicate set of dependencies just to call a tool with different parameters. And also (overlapping slightly with #8) we have the issue of where these snowflake files should live:
Do we try to parse the extension in the NPM script and pass it to the appropriate handler based on what returns? 🕳️
Do we have an svg folder and act on it differently? but stripping everything is the most common use-case, so really, it would be a folder (and set of rules) just for the occasion that you had an SVG that you didn't want stripped?
You can compress it by hand and manually put it somewhere else in lib. But this goes against the pattern of only touching src and so feels pretty icky. Plus it may require .gitignore fiddling, and could run afoul of the clean script that empties lib/assets depending on where you try to put it.
Linking directly to the file somewhere in src (whether you put it somewhere outside the toolchain or just ignore the improperly-compressed version created in lib). But that's inconsistent and also doesn't feel great given our attempts at separating sources from compiled assets....
Stop building websites and go to work on a farm.
The text was updated successfully, but these errors were encountered:
We're using
imagemin-cli
in order to keep things simple and lightweight. Butimagemin-cli
doesn't allow you to pass options to its underlying compression tools, so its version of SVGO will always strip classes and IDs for you, even if they're important to something you're planning on doing with said SVG....Maybe we should handle SVGs differently so we can run them through SVGO on our own? It's a slight bummer to include an essentially duplicate set of dependencies just to call a tool with different parameters. And also (overlapping slightly with #8) we have the issue of where these snowflake files should live:
Do we try to parse the extension in the NPM script and pass it to the appropriate handler based on what returns? 🕳️
Do we have an
svg
folder and act on it differently? but stripping everything is the most common use-case, so really, it would be a folder (and set of rules) just for the occasion that you had an SVG that you didn't want stripped?Current workarounds (and our issues with them):
Re-adding the stuff you need after the SVG gets compressed. 💣 Don't do this! 💣 It'll get clobbered and recompressed every time any file gets added/changed per [NPM Scripts] Image minification granularity of changes #7.
You can compress it by hand and manually put it somewhere else in
lib
. But this goes against the pattern of only touchingsrc
and so feels pretty icky. Plus it may require .gitignore fiddling, and could run afoul of theclean
script that emptieslib/assets
depending on where you try to put it.Linking directly to the file somewhere in
src
(whether you put it somewhere outside the toolchain or just ignore the improperly-compressed version created inlib
). But that's inconsistent and also doesn't feel great given our attempts at separating sources from compiled assets....Stop building websites and go to work on a farm.
The text was updated successfully, but these errors were encountered: