Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

owalo9's avatar

Default-exports vs named-exports

Can someone please shed more light on this statement from Axel Rauschmayer "Note that default-exporting objects is usually an anti-pattern (if you want to export the properties). You lose some ES6 module benefits (tree-shaking and faster access to imports)."

Trying to understand when to use which one? Do you define any listing rules imposing one over the other ?

0 likes
1 reply
owalo9's avatar

Can someone please shed more light on this statement from Axel Rauschmayer "Note that default-exporting objects is usually an anti-pattern (if you want to export the properties). You lose some ES6 module benefits (tree-shaking and faster access to imports)."

Trying to understand when to use which one? Do you define any listing rules imposing one over the other ? https://omegle.onl/ I got this,...

Please or to participate in this conversation.