wasm-pack has several commands to help you during the process of building
a Rust-generated WebAssembly project.
new: This command generates a new project for you using a template. Learn more
build: This command builds a
pkgdirectory for you with compiled wasm and generated JS. Learn more
publish: These commands will create a tarball, and optionally publish it to a registry, such as npm. Learn more
init: This command has been deprecated in favor of
wasm-pack displays a lot of useful information.
You can cause it to display even more information by using
--verbose, or you can silence all stdout by using
You can also use
--log-level to have fine-grained control over wasm-pack's log output:
--log-level infois the default, it causes all messages to be logged.
--log-level warncauses warnings and errors to be displayed, but not info.
--log-level errorcauses only errors to be displayed.
These flags are global flags, so they can be used with every command, and they must come before the command:
wasm-pack --log-level error build wasm-pack --quiet build wasm-pack --verbose build