#bundler #web #build-tool

app dister

Builds and bundles your wasm web app

10 releases

0.1.9 Apr 20, 2022
0.1.8 Apr 20, 2022

#603 in WebAssembly

Download history 10/week @ 2023-10-29 1/week @ 2023-11-12 11/week @ 2023-11-19 43/week @ 2023-11-26 11/week @ 2023-12-03 10/week @ 2023-12-17 20/week @ 2023-12-24 10/week @ 2023-12-31 1/week @ 2024-01-07 8/week @ 2024-01-14 10/week @ 2024-01-21 31/week @ 2024-01-28 11/week @ 2024-02-04

60 downloads per month

MIT license

5KB

dister

dister builds and bundles your wasm web app.

Installation

cargo install dister

Requirements

  • wasm32-unknown-unknown target:

rustup target add wasm32-unknown-unknown

  • Wasm-bindgen:

cargo install wasm-bindgen-cli

  • Wasm-opt (optional, wasm-opt is called if found in PATH and the --release flag is passed to dister build).

It can be downloaded from the binaryen repo's releases.

Usage

USAGE:
    dister <SUBCOMMAND>

SUBCOMMANDS:
    build     Build your wasm web app
    clean     Clean output artifacts
    serve     Serve the generated index.html
    deploy    Creates a desktop app using the wasm web app for frontend
    --help    Prints this message or the help of the given subcommand(s)

From the manifest directory of your wasm rust applications directory, run: dister build or dister build --release

It should generate a dist folder in the manifest directory. The generated html index file can then be served by any server or by running dister serve. If you prefer to use another server for development, pass the dist directory to the server: python3 -m http.server --dir dist

If dister finds an index.html shell in the manifest directory, it will use it and replace the {{SCRIPT}} placeholder (à la emscripten shell html) with a script to load the generated js glue code.

<html>
  <head>
  <meta charset="utf-8">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>
  <body>
    {{SCRIPT}}
  </body>
</html>

To create a desktop app:

dister deploy --width=800 --height=600 --title="app name"

Dependencies

~0.7–1MB
~21K SLoC