From b29ac0027bed19363ecec277cc50039b2db08dee Mon Sep 17 00:00:00 2001 From: webistomin Date: Sat, 24 Apr 2021 15:19:55 +0300 Subject: [PATCH] perf(vue-socials): remove useless babel polyfills --- .browserslistrc | 2 +- src/vue-socials-esm.ts | 5 ++++- src/vue-socials.ts | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.browserslistrc b/.browserslistrc index be09ccc..8bd72a4 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -7,4 +7,4 @@ not Edge < 79 iOS >= 10 Safari >= 10 Android >= 6 -Explorer >= 11 +Explorer > 11 diff --git a/src/vue-socials-esm.ts b/src/vue-socials-esm.ts index 3bda74d..0d0fe63 100644 --- a/src/vue-socials-esm.ts +++ b/src/vue-socials-esm.ts @@ -9,7 +9,10 @@ import * as components from '@/components'; * Install function executed by Vue.use() */ const install: Exclude = function installVueSocials(app: App) { - Object.entries(components).forEach(([componentName, component]) => { + Object.entries(components).forEach((item) => { + const componentName = item[0]; + const component = item[1]; + app.component(componentName, component); }); }; diff --git a/src/vue-socials.ts b/src/vue-socials.ts index 123a753..7dd666a 100644 --- a/src/vue-socials.ts +++ b/src/vue-socials.ts @@ -10,7 +10,10 @@ import plugin, * as components from '@/vue-socials-esm'; */ type NamedExports = Exclude; type ExtendedPlugin = typeof plugin & NamedExports; -Object.entries(components).forEach(([componentName, component]) => { +Object.entries(components).forEach((item) => { + const componentName = item[0]; + const component = item[1]; + if (componentName !== 'default') { const key = componentName as Exclude; const val = component as Exclude;