Eda Eren

  • JavaScript

Default exports can make tree-shaking harder for bundlers

[...] a module could provide only a default export, which is an object where all the functionality is exposed as properties of such an object. When we import a default object, most module bundlers will consider the entire object being used and they won't be able to eliminate any unused code from the exported functionality.

Node.js Design Patterns, Packt Publishing, 2020