Skip to content

Cleanup Configs to Generate Tree-Shakable ESM #101

Open
@whizzzkid

Description

@whizzzkid

This relates to:

The way we're generating ESM right now transpiles src into ESM which exports the required interfaces for performing geo-ip lookups. This works well for all agents that support module types and allows import/export syntax (e.g. browsers, node, etc) (except for the dependency issues in #100).

However, this takes away the ability to tree-shake the module when ipfs-geoip is included as a dependency to say ipfs-webui because we're unable to bundle this properly. e.g. https://github.com/ipfs-shipyard/ipfs-geoip/actions/runs/3287072521/jobs/5415859864#step:5:124

AI:

  • Cleanup Configs to build ESM valid in both Node-like and browser context
  • Establish imports are tree-shakeable
  • Setup better defaults to check this in aegir.

Would love to hear thoughts on this @SgtPooki, @lidel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions