Skip to content

Provide esm version #2434

Open
Open

Description

@tobiasdiez

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

Activity

  1. leibale commented on Mar 13, 2023

    @leibale
    Contributor

    @tobiasdiez is there a way to do it without doubling the "Unpacked Size"?

  2. tobiasdiez commented on Mar 13, 2023

    @tobiasdiez
    Author

    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.

  3. leibale commented on Mar 14, 2023

    @leibale
    Contributor

    @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..?

  4. tobiasdiez commented on Mar 14, 2023

    @tobiasdiez
    Author

    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.

  5. jay-l-e-e commented on May 17, 2025

    @jay-l-e-e

    I propose Solidis as an alternative solution to this problem.

  6. nekomeowww commented on Apr 24, 2026

    @nekomeowww

    Any plan for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions