Great news gsap is moving to es6! I like treeshaking and keep everything as small as possible!
However, what I don't understand is what the difference is between importing modules from 'gsap' vs. importing from 'gsap/all'.
So far I was importing modules from 'gsap', but in the docs I read it's better to import from 'gsap/all' for treeshaking sakes. But when I look at the all.js file inside gsap it's importing the modules, like I would do myself when I import directly from 'gsap', because the project structure is build that way, it seems.
Both ways work fine in having the same results onscreen, so I just looked at the output bundle size when I build the same project using imports from 'gsap', vs imports from 'gsap/all', and to my surprise there is a big difference in filesize:
Importing from 'gsap': total project bundle here is 547kB
Importing from 'gsap/all': total project bundle here is 612kB
So importing from 'gsap/all' results in a 65kB larger bundle!!
Btw, these import line's I'm using:
import { TweenLite, TimelineMax, Linear, Back, Sine } from 'gsap/all';
// vs
import { TweenLite, TimelineMax, Linear, Back, Sine } from 'gsap';
I thought that would be the other way around, because 'gsap/all' was adviced in the doc. But with this result I'd say it's better to import from 'gsap'.
@GreenSock Am I missing something here? What's the reason there is an extra option to import from 'gsap/all' instead of just 'gsap'? Thanks in advance!