A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://rustwasm.github.io/docs/wasm-pack/commands/pack-and-publish.html below:

pack and publish - Hello wasm-pack!

pack and publish - Hello wasm-pack!
  1. 1. Introduction
  2. 2. Quickstart
  3. 3. Prerequisites
    1. 3.1. npm (optional)
    2. 3.2. considerations
    3. 3.3. Non-rustup setups
  4. 4. Commands
    1. 4.1. new
    2. 4.2. build
    3. 4.3. test
    4. 4.4. pack and publish
    5. 4.5. init (DEPRECATED)
  5. 5. Tutorials
    1. 5.1. Hybrid applications with Webpack
      1. 5.1.1. Getting started
      2. 5.1.2. Using your library
    2. 5.2. npm browser packages
      1. 5.2.1. Getting started
        1. 5.2.1.1. Manual Setup
      2. 5.2.2. Template deep dive
        1. 5.2.2.1. Cargo.toml
        2. 5.2.2.2. src/lib.rs
        3. 5.2.2.3. src/utils.rs
        4. 5.2.2.4. wee_alloc
        5. 5.2.2.5. tests/web.rs
      3. 5.2.3. Building your project
      4. 5.2.4. Testing your project
      5. 5.2.5. Packaging and publishing
      6. 5.2.6. Using your library
  6. 6. Cargo.toml Configuration
  7. 7. Contributing
This documentation is no longer maintained at this domain, and is now maintained at drager.github.io/wasm-pack instead. Hello wasm-pack! pack and publish

The publish and pack commands interact with the pkg directory that's 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 pkg directory and publishes it to the NPM registry.

Underneath, these commands use npm pack and npm publish. You can read more about these in the NPM documentation:

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 of the pkg directory:

$ wasm-pack pack myproject/pkg
| 🎒  packed up your package!
$ wasm-pack pack myproject
| 🎒  packed up your package!

If you try to call pack or publish on another directory, you get an error:

$ wasm-pack pack myproject/src/
Unable to find the pkg directory at path 'myproject/src/', or in a child directory of 'myproject/src/'

If you don't set a path, they use the current directory as the path.

Publishing tagged releases

You can also publish tagged releases with the optional --tag argument, e.g.

wasm-pack publish --tag next

By default, the latest tag is used to identify the current version of a package, and npm install <pkg> (without any @<version> or @<tag> specifier) installs the latest tag.

You can read more about distribution tags on NPM.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4