Skip to content

docs: Added rel path to --out-dir example #1463

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions docs/src/commands/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ path is given, the `build` command will run in the current directory.

## Output Directory

By default, `wasm-pack` will generate a directory for its build output called `pkg`.
If you'd like to customize this you can use the `--out-dir` flag.
By default, `wasm-pack` generates a directory for its build output called `pkg`
in the same directory as the `Cargo.toml` file.
Use the `--out-dir` flag to place the build output in a different location.

```
wasm-pack build --out-dir out
```
Examples with and without the `--out-dir` flag:

- `wasm-pack build` - creates `pkg` directory next to `Cargo.toml` file
- `wasm-pack build --out-dir out` - creates `out` directory next to `Cargo.toml` file
- `wasm-pack build examples/js-hello-world --out-dir ../builds/js-hello-world` -
creates `examples/builds/js-hello-world`

The above command will put your build artifacts in a directory called `out`, instead
of the default `pkg`.
The `--out-dir` path can be absolute or relative to the directory that contains the `Cargo.toml` file.

## Generated file names

Expand Down
Loading