Skip to content

Conversation

brendandahl
Copy link
Contributor

Use binaryen's wasm-metadce to perform treeshaking on Wasm modules.

resolves #57

This builds on #55 and could use some more testing, but I wanted to get a little feedback before I go any further.

Directly import from an ES module following the ESM integration proposal.

e.g.
`(import "./add-esmi-deps.mjs" "getValue" (func $getValue (result i32)))`
Use binaryen's wasm-metadce to perform treeshaking on Wasm modules.

resolves unjs#57
@pi0 pi0 changed the title feat: support treeshaking Wasm modules feat: support treeshaking wasm modules Aug 18, 2025
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

❌ Patch coverage is 90.52632% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.15%. Comparing base (67a94a9) to head (f0363e4).
⚠️ Report is 35 commits behind head on main.

Files with missing lines Patch % Lines
src/plugin/runtime/treeshake.ts 86.44% 8 Missing ⚠️
src/plugin/index.ts 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
- Coverage   90.80%   89.15%   -1.65%     
==========================================
  Files           6        9       +3     
  Lines         500      415      -85     
  Branches       53       82      +29     
==========================================
- Hits          454      370      -84     
  Misses         45       45              
+ Partials        1        0       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Support tree shaking wasm in the rollup plugin
2 participants