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

fix: add "main" entry to package.json #457

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

adamhenson
Copy link
Contributor

@adamhenson adamhenson commented Jun 22, 2024

Issue:

Closes #456

What has been done:

  • Adds "main" entry in package.json

According to Node.js documentation only on older versions of Node.js should main be required.

For new packages targeting the currently supported versions of Node.js, the "exports" field is recommended. For packages supporting Node.js 10 and below, the "main" field is required. If both "exports" and "main" are defined, the "exports" field takes precedence over "main" in supported versions of Node.js.

Regardless, Parcel doesn't seem to honor the sole existence of exports (without main). This change will support both by allowing exports to take precedence per the above.

UPDATE: Seems like the issue could be due to conditional exports not supported in Parcel. I think this is good justification to add the main entry as a fallback for when conditional exports is not supported (like in the case of Parcel).

Copy link

vercel bot commented Jun 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sonner ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2024 3:45pm

@emilkowalski emilkowalski merged commit fcb3df0 into emilkowalski:main Jun 25, 2024
2 checks passed
@adamhenson adamhenson deleted the fix/456-parcel branch June 26, 2024 00:24
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.

Build failure with Parcel
2 participants