Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7
Description
Replaced
node-html-parser
with@xmldom/xmldom
for improved SVG parsing and manipulation. Actually, we don't need an HTML parser for SVG parsing - an XML parser is sufficient. Thenode-html-parser
package includes unnecessary CSS-related features, which adds extra dependencies to the utility. Additionally,node-html-parser
has a quirk where it adds closing tags instead of using self-closing, resulting in larger SVG sprite file sizes.Improved SVG spritesheet generation by switching from template strings to DOM operations, resulting in more reliable and maintainable code.
Fixed configuration in
remix-vite-cjs
to resolve startup issues.This pull request partially addresses issue Svg minification #7, as the unformatted SVG file will now contain only three lines (first line for XML declaration and last line empty). In my opinion, features like optimizing paths and inlining styles are out of scope for this library, and SVGO already handles these tasks well. Therefore, I suggest closing issue Svg minification #7.
Added more meaningful examples for file generation.
Type of change
Please mark relevant options with an
x
in the brackets.How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also
list any relevant details for your test configuration
Reviewer checklist
Mark everything that needs to be checked before merging the PR.
Screenshots (if appropriate):
Questions (if appropriate):