node-redis
node-redis copied to clipboard
Provide esm version
Motivation
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
@tobiasdiez is there a way to do it without doubling the "Unpacked Size"?
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.
@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..?
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.
I propose Solidis as an alternative solution to this problem.