-
Notifications
You must be signed in to change notification settings - Fork 409
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
wasm-strip
reduces bundle size inexplicably
#543
Comments
@surma yeah! i was actually thinking about this after our in person hack sesh at the meetup. the biggest blocker to adding tools to wasm-pack is the availability of a rust library and/or linux/macOS/windows binaries (the binaries are the preferred option). would you be willing to take a look into the availability of these binaries? if they exist, adding wasm-strip should be otherwise not too difficult. also a side note- wasm-pack defaults to release so this is a feature that would be run by default and turned off for when wasm-pack runs in --dev mode. |
I think we would only want to run Either way -- if we add support for this, we would want to control it via the toml config. |
@fitzgen agree we'd only want it for --release, which is the "default" (i.e. not on --dev, or debug, or the others) it certainly appears that |
As I mentioned in the title, I definitely meant So it seems that custom sections do not get stripped. (That being said, I think this might have been a change in 1.32 or something. I believe when I was on 1.30 the binary was way smaller) |
Figured out why the DWARF isn't getting stripped: rustwasm/wasm-bindgen#1254 |
@surma could you try the newest release of wasm-bindgen and confirm this is fixed? (i'd expect that |
I updated the Invoking |
I think we need to be more concrete about examples, expectations, and actual behavior here, so it would be useful to have:
|
@surma sorry for the Extreme Delay. any status update on this? if you have a way to repro that'd be great. |
wasm-strip
with --release
wasm-strip
reduces bundle size inexplicably
Apologies! I lost track of this as well! Here’s a repro repo: https://github.com/surma-dump/wasm-pack-issue-543 Repro steps:
Expected: File size remains the same Currently observed: File size got smaller after running |
I've got a different story to share:
Result: After running |
💡 Feature description
Building the default example project as a release build yields some rather big wasm modules, which might be deterring to some:
Command:
wasm-pack build --release
After running
wasm-strip
, the size goes down drastically:Anything speaking against running
wasm-strip
automatically, at least for--release
?wasm-pack 0.6.0
rustc 1.32.0 (9fda7c223 2019-01-16)
rustc 1.34.0-nightly (57d7cfc3c 2019-02-11)
The text was updated successfully, but these errors were encountered: