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

Add exports in package.json #892

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Add exports in package.json #892

merged 1 commit into from
Jan 28, 2025

Conversation

tushuhei
Copy link
Member

This PR improves the package distribution of Budoux to enhance compatibility and usability in various JavaScript environments.

Specifically, it addresses the following:

  • Node.js ESM Support: Previously, the build process for ESM would incorrectly overwrite win.ts with win-browser.ts. This prevented Node.js environments from using the ESM build, as win-browser.ts relies on browser-specific APIs. This change ensures that Node.js can properly import and use the ESM version of Budoux.
  • Enhanced Package Resolution with exports Field: The addition of the exports field in package.json provides explicit mappings for different module formats (CommonJS and ESM). This improves interoperability with modern JavaScript bundlers and frameworks, ensuring they correctly resolve the appropriate module format and avoid potential conflicts. This also simplifies usage for developers by providing clear entry points.

@tushuhei tushuhei requested a review from kojiishi January 25, 2025 07:13
@viiccwen
Copy link

Hello, @tushuhei. Does this PR try to fix issue #888 ?

@tushuhei
Copy link
Member Author

Partially. This should fix the first problem I pointed out.

Copy link
Collaborator

@kojiishi kojiishi left a comment

Choose a reason for hiding this comment

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

LGTM

@tushuhei tushuhei merged commit 17db4d8 into main Jan 28, 2025
26 checks passed
@tushuhei tushuhei deleted the better-export branch March 11, 2025 05:29
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.

3 participants