Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optimize SVGs during build #30

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

mojoaxel
Copy link
Contributor

@mojoaxel mojoaxel commented Apr 19, 2023

Summary

I want to import icons as svg files and I realized that they are not optimized. e.g

  • lots of unnecessary decimal places
  • use of transforms/translates
  • unnecessary tags

I introduced svgo as a gulp step to optimize the svg files early.

this reduces the size of the dist assets:

  • svg/: 963,1 --> 399,7 kB

How did you test this change?

  • 👀 It looks like no icons where harmed during this PR
  • 🤖 I tries to use yarn test to test for regressions but it looks like these fail also in main.
    See broken regression tests #29

@mojoaxel mojoaxel marked this pull request as ready for review April 19, 2023 10:02
@danielleroux danielleroux self-assigned this Apr 24, 2023
@danielleroux
Copy link
Collaborator

@mojoaxel yes, we plan a major refactoring with the next major release of @siemens/ix. We need some time to get your work synced wth our current working state.

@nuke-ellington
Copy link
Collaborator

@mojoaxel could you please bring your branch up to date with main so we can have a final review? Thanks!

@mojoaxel mojoaxel force-pushed the optimize-svgs branch 2 times, most recently from d3f6bc4 to 703a44a Compare November 19, 2023 14:22
@mojoaxel
Copy link
Contributor Author

@nuke-ellington I've rebeased on the current main and removed the icon-font support in my branch.

Now it's a very minimal change, just introducing svgo to the build pipeline, which reduces the svg folder-size by ~60%.

@nuke-ellington nuke-ellington added this to the 2.1.0 milestone Nov 20, 2023
@nuke-ellington nuke-ellington merged commit ca76949 into siemens:main Nov 20, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants