-
-
Notifications
You must be signed in to change notification settings - Fork 253
Description
I have found this issue while investigating why my project still had the entire date-fns library bundled even if I was carefully importing and using only a few functions.
date-fns provides a syntax that will allow bundlers like Webpack to do some "tree-shaking" and only import the needed modules rather than the full library, optimizing greatly the total bundle size.
It seems like concurrently doesn't use this syntax, which causes to import the full date-fns library instead of only the single function used in logging (formatDate in logger.ts and log-timings.ts).
How found this :
I had opened an issue about this originally on the date-fns repo because I thought it came from there.
After some discussions around the issue, someone mentioned here that it could come from another dependency importing all of date-fns by not using tree-shaking syntax. The recommendation was to use npm why date-fns to spot which other dependency may use date-fns.
When running that command, it only listed my own references to date-fns (using the syntax allowing tree-shaking) and the concurrently library.