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

Why is the final bundle so big? #187

Open
paulogr opened this issue Oct 16, 2019 · 4 comments
Open

Why is the final bundle so big? #187

paulogr opened this issue Oct 16, 2019 · 4 comments
Labels

Comments

@paulogr
Copy link

paulogr commented Oct 16, 2019

Hi, i'm using this package for while and looking at the code and dependencies can't figure out why the final bundle has 79.5kb minified.

Can someone help me to figure out why?

Thanks!

@linx4200 linx4200 added the 3.0 label Feb 27, 2020
@ghost
Copy link

ghost commented Apr 21, 2020

Is there anyway I could only import what I only need?
I've checked the bundled size and it is importing everything that the component offers.

Screen Shot 2020-04-21 at 7 31 56 PM

How do I modify it to only import Photoshop or Sketch only for example ?

@guanzo
Copy link

guanzo commented May 16, 2020

This library should be tree shakeable, 100%. It's way too big. Especially since most users will only import 1 or a few components.

@paulogr @davidmandeeli

In the meantime, if you have something like this

import { Sketch as SketchPicker } from 'vue-color'

You can replace it with

import SketchPicker from 'vue-color/src/components/Sketch'

I've verified that the resulting bundle is much smaller. From 80kib to 13kib

@paulogr
Copy link
Author

paulogr commented May 20, 2020

Uow man, thanks, it helps a lot!

I'm using the Chrome picker was reduced from 80kb to 27kb, the +14kb it's for tinycolor dependency.

@yellow1912
Copy link

Not sure if this works with the latest version anymore, I keep getting "vue-color\src\components\Chrome doesn't exist"

I think it expects a .js file while the src is a .vue file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants