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

perf: include social icons on demand #1789

Merged
merged 3 commits into from
Jan 28, 2025
Merged

perf: include social icons on demand #1789

merged 3 commits into from
Jan 28, 2025

Conversation

chenjiahan
Copy link
Member

@chenjiahan chenjiahan commented Jan 27, 2025

Summary

Rspress will bundle all unused social icons into the final bundles, resulting in a larger bundle size.

This PR converts all social icons to HTML strings, move them to the Node.js side and only include used icons via source.define.

before

Screenshot 2025-01-27 at 21 12 22

after

reduced 19.5kB

Screenshot 2025-01-27 at 21 38 14

Related Issue

resolve #1760

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Jan 27, 2025

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
🔨 Latest commit 1103195
🔍 Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/679790d70759490008596bcd
😎 Deploy Preview https://deploy-preview-1789--aquamarine-blini-95325f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 92 (🟢 up 10 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@chenjiahan chenjiahan changed the title perf: inject social icons on demand perf: include social icons on demand Jan 27, 2025
@Timeless0911 Timeless0911 merged commit 658d1f2 into main Jan 28, 2025
7 checks passed
@Timeless0911 Timeless0911 deleted the social_icons_0127 branch January 28, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: treeshaking the unused socialLinks
2 participants