Skip to content

Define Package Exports in package.json #2282

@FredKSchott

Description

@FredKSchott

In Node v13, package exports were introduced as an official way to define sub-paths/modules within your package: https://nodejs.org/api/esm.html#esm_package_exports

in the past, Preact has defined sub-package.json's within the package, to represent each sub-package so that node's resolution logic would automatically load the right files within them. While that should continue to work (I think) this is the new, "blessed" way forward.

I'm getting ready to enable this for Pika CDN, and would like some packages to test against. If Preact enabled this, we could give your users support for preact/hooks, preact/debug, etc. on our CDN.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions