Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Healthire/wasm-build
Browse files Browse the repository at this point in the history
  • Loading branch information
HexyWitch committed Mar 18, 2018
2 parents 45b18d8 + 73363b6 commit 7e79e37
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions README.md
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

0 comments on commit 7e79e37

Please sign in to comment.