Daniel Hult Posted October 29, 2020 Share Posted October 29, 2020 Hi! Is it possible to treeshake things from the core that you dont use? Like utility functions and eases e.g. Link to comment Share on other sites More sharing options...
GreenSock Posted October 30, 2020 Share Posted October 30, 2020 Not really. The only thing you can do is rip out CSSPlugin completely from the core, but I doubt you want to do that. It's only useful if you don't animate any DOM elements. The utility methods are mostly things that are already being used deep in the guts of the engine, so we exposed them for convenience. It's not like they're just fluff. If we wrote everything in a way that's solely focused on tree shaking, it would actually make the engine quite a bit larger and more cumbersome to use. For example, the eases leverage common builder functions that significantly reduce the code necessary. Separating and isolating them all (for tree shaking) would probably triple the code. And of course it'd force you to import each ease whenever you want to use one (instead of using the convenient strings). See what I mean? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now