Skip to content

Conversation

@guybedford
Copy link
Contributor

This PR updates the "exports" definitions to match the expectations of logical conditional exports ordering (nodejs/node#31008).

The idea there is that we can think of the "exports" object as an ordered conditional like a series of if statements, which was integrated with feedback from tooling authors.

The definitions written here though would never match the "browser" or "umd" conditions because the "require" or "import" condition would act as a catch-all, like having an if (true) with further if statements below.

The general rule is to put the most specific conditional exports first, although I can appreciate if this might seem counter-intuitive.

Further discussion / feedback welcome.

@coveralls
Copy link

coveralls commented Feb 10, 2020

Coverage Status

Coverage remained the same at 99.792% when pulling e240178 on guybedford:patch-1 into ca8eb87 on preactjs:master.

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you so much for your contribution 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants