Rewrite the README using Webpack

Right now Webpack probably has the most mature support for loading wasm modules,
so let's show off how to do that! Additionally this commits hello world as an
example to the repository.
This commit is contained in:
Alex Crichton
2018-03-02 20:11:30 -08:00
parent 30986dacad
commit 4aa6793b9e
14 changed files with 180 additions and 36 deletions

View File

@ -0,0 +1,16 @@
#![feature(proc_macro)]
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern {
fn alert(s: &str);
}
#[wasm_bindgen]
#[no_mangle]
pub extern fn greet(name: &str) {
alert(&format!("Hello, {}!", name));
}