Jump to content
Search Community

Gsap imports tree shaking reduce bundle size?

ricky11 test
Moderator Tag

Recommended Posts

I am importing gsap as so :

 

 const {default : gsap} = import(/* webpackChunkName: "gsap" */ 'gsap/dist/gsap.min.js')

 

this is great because i don't need to load the 60kb gsap build on every load, and only when and if its needed.


The problem however is that I am only using one simple tween function to animate numbers going from 0 to 100.

 

Can I tree shake gsap code to tween only ?  60 kb does seem like a lot for what i am doing?

 

thanks.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...