Merge pull request #485 from fitzgen/minor-docs-stuff

Minor docs stuff
master
ashley williams 6 years ago committed by GitHub
commit 5fafee7657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      docs/src/commands/build.md
  2. 12
      docs/src/commands/pack-and-publish.md

@ -5,6 +5,10 @@ interoperability and for publishing a package to npm. This involves compiling
your code to wasm and generating a pkg folder. This pkg folder will contain the your code to wasm and generating a pkg folder. This pkg folder will contain the
wasm binary, a JS wrapper file, your `README`, and a `package.json` file. wasm binary, a JS wrapper file, your `README`, and a `package.json` file.
The `pkg` directory is automatically `.gitignore`d by default, since it contains
build artifacts which are not intended to be checked into version
control.<sup>[0](#footnote-0)</sup>
## Path ## Path
The `wasm-pack build` command can be given an optional path argument, e.g.: The `wasm-pack build` command can be given an optional path argument, e.g.:
@ -85,3 +89,9 @@ wasm-pack build examples/js-hello-world --mode no-install
|---------------|------------------------------------------------------------------------------------------| |---------------|------------------------------------------------------------------------------------------|
| `no-install` | `wasm-pack init` implicitly and create wasm binding without installing `wasm-bindgen`. | | `no-install` | `wasm-pack init` implicitly and create wasm binding without installing `wasm-bindgen`. |
| `normal` | do all the stuffs of `no-install` with installed `wasm-bindgen`. | | `normal` | do all the stuffs of `no-install` with installed `wasm-bindgen`. |
<hr style="font-size: 1.5em; margin-top: 2.5em"/>
<sup id="footnote-0">0</sup> If you need to include additional assets in the pkg
directory and your NPM package, we intend to have a solution for your use case
soon. [](#wasm-pack-build)

@ -1,9 +1,9 @@
# pack and publish # pack and publish
The `publish` and `pack` commands interact with the pkg directory that's The `publish` and `pack` commands interact with the pkg directory that's
created when you run `wasm-pack init`. The `pack` command creates a tarball created when you run `wasm-pack build`. The `pack` command creates a tarball
from the pkg directory and the `publish` command creates a tarball from the from the pkg directory and the `publish` command creates a tarball from the
pkg directory __and__ publishes it to the NPM registry. pkg directory __and__ publishes it to the NPM registry.
Underneath, these commands use `npm pack` and `npm publish`. You can read Underneath, these commands use `npm pack` and `npm publish`. You can read
more about these in the NPM documentation: more about these in the NPM documentation:
@ -11,8 +11,8 @@ more about these in the NPM documentation:
- [`npm pack`](https://docs.npmjs.com/cli/pack) - [`npm pack`](https://docs.npmjs.com/cli/pack)
- [`npm publish`](https://docs.npmjs.com/cli/publish) - [`npm publish`](https://docs.npmjs.com/cli/publish)
Both these commands take the path to the pkg directory as the first argument. Both these commands take the path to the pkg directory as the first argument.
You can either set the argument directly to the pkg directory or to the parent You can either set the argument directly to the pkg directory or to the parent
of the pkg directory: of the pkg directory:
``` ```

Loading…
Cancel
Save