Skip to content

feat: Export ./package.json in exports field for Module Federation support#1062

Merged
franky47 merged 3 commits into47ng:nextfrom
AfeefRazick:next
Aug 14, 2025
Merged

feat: Export ./package.json in exports field for Module Federation support#1062
franky47 merged 3 commits into47ng:nextfrom
AfeefRazick:next

Conversation

@AfeefRazick
Copy link
Contributor

@AfeefRazick AfeefRazick commented Aug 13, 2025

Context

This change addresses an issue raised in Issue #1060: currently, package.json isn’t listed in the "exports" field of the package. Tools like Vite Module Federation rely on this entry to resolve the package correctly.

What’s Changed

  • Added "./package.json": "./package.json" to the "exports" field in package.json.

Why It Matters

  • Module Federation compatibility: Without this entry, Vite Module Federation fails to locate and load package.json, resulting in resolution errors
  • Consistency: Aligns with patterns used by other libraries that explicitly export their package.json when needed.

Steps to Verify

  1. Install the updated nuqs package in a Vite-based project with Module Federation enabled.
  2. Attempt to import or load the package.
  3. Build module federation project to confirm that there are no resolution errors related to package.json.

Closes #1060.

@vercel
Copy link

vercel bot commented Aug 13, 2025

@AfeefRazick is attempting to deploy a commit to the 47ng Team on Vercel.

A member of the Team first needs to authorize it.

@franky47 franky47 added the deploy:preview Deploy a preview version of this PR on pkg.pr.new label Aug 13, 2025
@franky47 franky47 changed the title feat: export ./package.json in exports field for Module Federation support feat: Export ./package.json in exports field for Module Federation support Aug 13, 2025
@franky47 franky47 added this to the 🪵 Backlog milestone Aug 13, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 13, 2025

pnpm add https://pkg.pr.new/nuqs@1062

commit: 5e020fb

@vercel
Copy link

vercel bot commented Aug 13, 2025

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

Project Deployment Preview Comments Updated (UTC)
nuqs Ready Preview Comment Aug 14, 2025 2:40pm

@franky47 franky47 merged commit 6590795 into 47ng:next Aug 14, 2025
48 of 49 checks passed
@github-actions
Copy link

🎉 This PR is included in version 2.5.0-beta.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 2.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@franky47 franky47 removed this from the 🚀 Shipping next milestone Aug 22, 2025
@franky47 franky47 mentioned this pull request Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy:preview Deploy a preview version of this PR on pkg.pr.new released on @beta released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ./package.json to exports for compatibility with Vite Module Federation

2 participants