You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With more and more build tools (vite, nuxt, etc) going towards an esm-first build, it would be nice if a proper esm interface could be provided, i.e. transpile and distribute esm version, including correct export declaration in package.json.
Basic Code Example
No response
Reacted by Vlad Sirenko, hiepxanh, Laszlo Heves, Jan Willem van Jaarsveld, Jay Lee, Danilo Fuchs and Lukas Heizmann
No not really, you do need to distribute both versions. But the metric "unpacked size" is misleading anyway, since distributing an esm version would actually allow bundlers to treeshake effectively so that the effective size for peoples apps decreases.
Yes, reducing the distribution size is particularly important for edge/serverless, but more generally many popular fullstack frameworks like next or nuxt run the server build through webpack or vite, and they would profit from esm support.
Reacted by Benjamin Besse, Alex Duval, Laszlo Heves, Jan Willem van Jaarsveld, Jay Lee and ggascoigne-fablegate
Activity
leibale commentedon Mar 13, 2023
@tobiasdiez is there a way to do it without doubling the "Unpacked Size"?
tobiasdiez commentedon Mar 13, 2023
No not really, you do need to distribute both versions. But the metric "unpacked size" is misleading anyway, since distributing an esm version would actually allow bundlers to treeshake effectively so that the effective size for peoples apps decreases.
leibale commentedon Mar 14, 2023
@tobiasdiez I assume most people do not bundle the server code, let alone tree-shaking.. maybe in this new world of "edge functions" I'm incorrect..?
tobiasdiez commentedon Mar 14, 2023
Yes, reducing the distribution size is particularly important for edge/serverless, but more generally many popular fullstack frameworks like next or nuxt run the server build through webpack or vite, and they would profit from esm support.
jay-l-e-e commentedon May 17, 2025
I propose Solidis as an alternative solution to this problem.
nekomeowww commentedon Apr 24, 2026
Any plan for this?