Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move package.json exports support to a config option #8956

Merged
merged 3 commits into from
May 10, 2023

Conversation

devongovett
Copy link
Member

Unfortunately enabling package.json "exports" field support by default would be a breaking change. This is due to many reasons, two of which are:

  1. Un-exported paths would suddenly fail to resolve where they did not before.
  2. require and import could now resolve to different modules due to export conditions, resulting in broken singletons (e.g. React context).

Therefore, until the next major version, package exports support will be opt-in by adding the following to your project root package.json:

{
  "@parcel/resolver-default": {
    "packageExports": true
  }
}

@devongovett devongovett merged commit eb76826 into v2 May 10, 2023
13 of 16 checks passed
@devongovett devongovett deleted the package-exports-default branch May 10, 2023 20:25
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.

None yet

2 participants