Skip to content

Support tree shaking wasm in the rollup plugin #57

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

Open
1 task done
brendandahl opened this issue Apr 10, 2025 · 0 comments
Open
1 task done

Support tree shaking wasm in the rollup plugin #57

brendandahl opened this issue Apr 10, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@brendandahl
Copy link

Describe the feature

When there are unused exports from a Wasm module they should be removed.

One possible way to do this:

  1. Get the unused exports during generateBundle from module.removedExports
  2. Read all the exports from the wasm file
  3. Remove the unused exports from that list
  4. Put those exports in a JSON file in the format that wasm-metacde (from binaryen) understands
  5. Run wasm-metadce on the binary

FWIW, I've done something similar in a emscripten specific plugin here.

Additional information

  • Would you be willing to help implement this feature?
@brendandahl brendandahl added the enhancement New feature or request label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant