-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Healthire/wasm-build
- Loading branch information
Showing
1 changed file
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,45 @@ | ||
# wasm-build | ||
Tool for building and packaging rust wasm projects, using wasm-bindgen for generating bindings | ||
|
||
[![Build Status](https://travis-ci.org/Healthire/wasm-build.svg?branch=master)](https://travis-ci.org/Healthire/wasm-build) | ||
|
||
This tool is intended to be used in conjunction with [wasm-bindgen](https://github.com/alexcrichton/wasm-bindgen). Its primary intended use is to package and run wasm modules produced by wasm-bindgen in a web browser context. | ||
Tool for building and packaging rust wasm projects using [wasm-bindgen](https://github.com/alexcrichton/wasm-bindgen) for web. | ||
|
||
## Work In Progress | ||
|
||
This tool is a work in progress and is not fully implemented yet. | ||
|
||
## Planned features | ||
## Usage | ||
|
||
wasm-build depends on [yarn](https://yarnpkg.com/en/) | ||
|
||
### Setup | ||
|
||
1. Install [yarn](https://yarnpkg.com/en/) | ||
2. Install wasm-build as a cargo package | ||
``` | ||
$ cargo install --git https://github.com/Healthire/wasm-build | ||
``` | ||
3. Done! | ||
|
||
### Building | ||
|
||
Building is as simple as running the build command in your project directory | ||
``` | ||
$ wasm-build build | ||
``` | ||
During the build process wasm-build will ask you to confirm automatically installing [wasm-bindgen](https://github.com/alexcrichton/wasm-bindgen) CLI tool and [webpack](https://webpack.js.org/) if they are not found on your system. | ||
|
||
The wasm-build build outputs a bundled javascript app to ./target/wasm-build/<target_name>/dist/<target_name>.js. | ||
|
||
### Running | ||
|
||
Running a packaged is as easy as building. | ||
``` | ||
$ wasm-build run | ||
``` | ||
When the build is finished, the application will be served at http://localhost:8000. | ||
|
||
A static HTML file can be served instead of the default HTML index by creating a ./html/<target_name>.html file. | ||
|
||
## Possible future features | ||
|
||
* Packaging binary targets into html bundles | ||
* Packaging library targets into es6 modules | ||
* Run binary targets (package html bundle and host it from a webserver) | ||
* Run tests (package test bundles and run tests in headless browser) | ||
* Possibly separate browser/nodejs modes for running binaries and tests |