-
Notifications
You must be signed in to change notification settings - Fork 819
Open
Description
In projects that merge files, many of the exports in the intermediate files may be meant for the others they are merged with, and not for the final binary. Having a way to declare the "final/public" exports may be useful.
Some options here, from recent discussions:
- The metadce tool can remove exports today, but it would be a separate invocation.
- We could add a new wasm-merge flag, perhaps like
wasm-merge --final-exports=WILDCARD. Specifying the list at link-time is similar to e.g. Emscripten's EXPORTED_FUNCTIONS, but it might be very long. - We could use custom annotations in the individual files ("X is a final/public export"), and have wasm-merge read and use those. Some questions we'd need to resolve:
- We want to annotate exports, not functions - functions can have multiple exports, making this ambiguous otherwise. Custom annotations lacks that atm.
- When are the annotations used and discarded? If wasm-merge does this automatically, it would prevent intermediate merges (which may be good for compile times).
bashor
Metadata
Metadata
Assignees
Labels
No labels