Skip to content

fix: drop @rolldown/binding-wasm32-wasi from published optionalDependencies - #8500

Closed
shulaoda with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-empty-dependency-packages
Closed

shulaoda with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-empty-dependency-packages

Conversation

Copilot AI commented Feb 28, 2026 •

Copy link
Copy Markdown
Contributor

Installing rolldown pulls in @emnapi/*, @napi-rs/wasm-runtime, and @tybys/wasm-util on every platform because napi pre-publish adds @rolldown/binding-wasm32-wasi to optionalDependencies, and npm doesn't recognize cpu: ["wasm32"] as a platform constraint — so it installs the package (and its transitive deps) unconditionally.

Changes

  • packages/rolldown/scripts/remove-wasi-dep.cjs — new script that deletes @rolldown/binding-wasm32-wasi from optionalDependencies in package.json
  • packages/rolldown/package.json — chain the cleanup script after napi pre-publish in prepublishOnly:
    "prepublishOnly": "napi pre-publish -t npm --no-gh-release && node ./scripts/remove-wasi-dep.cjs"

The WASI package itself continues to be built and published as a standalone package. The WASI fallback in binding.cjs still works for users who install @rolldown/binding-wasm32-wasi explicitly.

Original prompt

This section details on the original issue you should resolve

<issue_title>Need to remove some empty dependency packages</issue_title>
<issue_description>Image
I found that after installing npm i, there are some empty directories in the node_modules directory. Is there a solution to this problem? Do not create unnecessary dependency packages in node_modules.
This issue has led to the problem of node_modules appearing bloated.</issue_description>

Comments on the Issue (you are @copilot in this section)

@hyf0 @shulaoda Can you help check this?

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify

netlify Bot commented Feb 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 0727458
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69a2fc272f3cd6000829ed46
😎 Deploy Preview https://deploy-preview-8500--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…o prevent unnecessary packages in node_modules

Co-authored-by: shulaoda <[email protected]>
Copilot AI changed the title [WIP] Remove empty dependency packages from node_modules fix: drop @rolldown/binding-wasm32-wasi from published optionalDependencies Feb 28, 2026
@shulaoda shulaoda closed this Mar 31, 2026
@shulaoda
shulaoda deleted the copilot/remove-empty-dependency-packages branch June 19, 2026 15:24
felixonmars added a commit to felixonmars/archriscv-packages that referenced this pull request Oct 16, 2026
Use the installed pnpm with pmOnFail: ignore. Delegation to the pinned
11.3.0 release fails because its native launcher has no riscv64 binary.

Approve @actions/github-script by its Git repository URL. pnpm 12 does
not apply name-only approvals to Git dependencies, causing
ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED in prepare(). Use upstream's
repository selector to cover the locked GitHub tarball.

Add the matching Rolldown 1.2.9 WASI binding through a package extension
and allow the required lockfile update. Its native riscv64 target
remains unmerged.

https://archriscv.felixc.at/.status/logs/matrix-authentication-service/matrix-authentication-service-1.27.0-1.log
https://github.com/pnpm/pnpm/blob/v12.13.0/pnpm/crates/cli/src/cli_args/pre_command/pin.rs
https://github.com/pnpm/pnpm/blob/v12.13.0/.changeset/allow-git-tarball-builds-by-repo-url.md
https://github.com/element-hq/matrix-authentication-service/blob/v1.27.0/pnpm-lock.yaml
rolldown/rolldown#8500
rolldown/rolldown#10665
felixonmars added a commit to felixonmars/archriscv-packages that referenced this pull request Nov 22, 2026
Rolldown 1.2.8 no longer installs its standalone WASI binding by default, so the existing allocator workaround stopped at prepare() because the loader file was absent. Add the matching binding through a pnpm package extension and refresh the allocator patch for the new beforeInit layout.

https://archriscv.felixc.at/.status/logs/podman-desktop/podman-desktop-1.30.7-1.log

rolldown/rolldown#8500
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.

Need to remove some empty dependency packages

2 participants