vue-tel-input icon indicating copy to clipboard operation
vue-tel-input copied to clipboard

Option to have separate builds/import versions with less features and less weight

Open shershen08 opened this issue 5 years ago • 7 comments

First, thanks for a great UI library!

Since vue-tel-input is a high level UI component it makes use of several other packages:

  • Telephone Number parsing, validation by libphonenumber-js.
  • Country Codes data from intl-tel-input.
  • Country Flags by behdad/region-flags.
  • User's Location by get-json and ipifo.io

by directly importing them (https://github.com/EducationLink/vue-tel-input/blob/master/src/assets/default-country.js#L1, etc).

That lead to the situation that by using vue-tel-input I got +92kb extra in my minified and gzipped bundle ;(( That's a common problem with ecosystem, but I'd say it's too much for just for one phone input...

Maybe there could be a pre built bundles that don't use some of the functionality.

// generic with all features
import {VueTelInputFull} from 'vue-tel-input'

// if I don't use flags and geo location feature
import {VueTelInputNoGeolocation} from 'vue-tel-input'

// etc

shershen08 avatar May 01 '19 15:05 shershen08

@shershen08 thanks for reaching out. It sounds like a very good idea, we might implement it in the next releases.

iamstevendao avatar May 02 '19 12:05 iamstevendao

@iamstevendao I'll try create a PR on that one

shershen08 avatar May 03 '19 14:05 shershen08

@shershen08 <3

iamstevendao avatar May 04 '19 01:05 iamstevendao

Any update on this?

cavinpabua avatar Oct 25 '19 05:10 cavinpabua

This would be really useful!

DominicGBauer avatar Jan 14 '20 14:01 DominicGBauer

I didn't know this library is so huge. badge https://bundlephobia.com/[email protected]

It's the same size as entire bootstrap.

probil avatar Mar 31 '20 08:03 probil

Any update on this? This would be really useful to improve overall bundle size

Sebachowa avatar May 18 '20 07:05 Sebachowa