From 0c8cf0df8903b3f48ccffa17c92fc988d88b7ad7 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 10 Aug 2023 02:41:53 +0530 Subject: [PATCH] perf: extract social icons as plugin to avoid unused icons (#2768) --- src/client/shim.d.ts | 5 +++ .../theme-default/components/VPSocialLink.vue | 2 +- src/node/plugin.ts | 16 ++++---- .../plugins/socialIconsPlugin.ts} | 40 +++++++++++++++++-- types/default-theme.d.ts | 1 + 5 files changed, 52 insertions(+), 12 deletions(-) rename src/{client/theme-default/support/socialIcons.ts => node/plugins/socialIconsPlugin.ts} (82%) diff --git a/src/client/shim.d.ts b/src/client/shim.d.ts index b53e8ab2..c54183d2 100644 --- a/src/client/shim.d.ts +++ b/src/client/shim.d.ts @@ -33,3 +33,8 @@ declare module 'mark.js/src/vanilla.js' { const mark: Mark export default mark } + +declare module 'virtual:vp-social-icons' { + const data: Record + export default data +} diff --git a/src/client/theme-default/components/VPSocialLink.vue b/src/client/theme-default/components/VPSocialLink.vue index ae7b097a..14d14288 100644 --- a/src/client/theme-default/components/VPSocialLink.vue +++ b/src/client/theme-default/components/VPSocialLink.vue @@ -1,7 +1,7 @@