Skip to content

Commit

Permalink
docs: Added 2 more --out-dir examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rimutaka committed Jan 10, 2025
1 parent ddfb21c commit 3da9f3f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/src/commands/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ 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 examples/js-hello-world --out-dir ../builds/js-hello-world
```
Examples with and without the `--out-dir` flag:

The above command will create directory `examples/builds/js-hello-world`
and place the build artifacts there, instead of the default `examples/js-hello-world/pkg`.
- `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 `--out-dir` path can be absolute or relative to the directory that contains the `Cargo.toml` file.

Expand Down

0 comments on commit 3da9f3f

Please sign in to comment.