You can use "-ldflags='-s -w'" to reduce the size, but it is expected that 
wasm files will be in the order of MBs (see 
https://golang.org/doc/go1.11#wasm). 

> So I was wondering if there are tools that parse the .wasm and prune 
unused pkgs?

The size is not due to unused packages being imported, but rather the 
runtime and scheduling code. See the relnotes above.

On Tuesday, 26 March 2019 17:45:08 UTC+5:30, whiteh...@googlemail.com wrote:
>
> I know that the Go wasm support is still experimental, although it seems 
> to be working great here! :) but are there any tools for pruning the .wasm 
> output?  I'm only using about 3 pkg imports but end up with a 2.6MB .wasm 
> file.  I've seen the suggestion for using tinygo, but I didnt get that 
> working here...  
>
> So I was wondering if there are tools that parse the .wasm and prune 
> unused pkgs?  
>
> Or are there plans to add any pruning to Go core?  So far I saw the file 
> size increase between 1.11 and 1.12...
>
> Also, from what I've read about wasm so far, there is some support for 
> modules.  Which to me sounds like one wasm module should be able to talk to 
> another wasm module directly, avoiding the js bridge.  Does Go in anyway 
> support this concept, or have I misunderstood it?
>
> Thanks, Peter
>
> macos10.12.4, Go 1.12
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to