wasmpack

command
v1.164.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command wasmpack shrinks a Go js/wasm binary after linking.

On wasm the linker gives every function 64 KiB of PC space, so runtime.findfunctab holds 320 bytes per function: sixteen buckets, each the function's index followed by sixteen zero bytes. wasmpack removes that table from the data section and adds a start function that writes it back at instantiation. It then re-splits the remaining data around runs of zeroes, which the linker stops doing once the table has used up its segment budget.

The table is found by its content and only removed when the start function reproduces it byte for byte, so memory after instantiation is unchanged. A module without such a table is left as it is.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL