From a5ad9ed121f0bf704a60eae905410cb836fb6b32 Mon Sep 17 00:00:00 2001 From: Robert Debug Date: Wed, 28 Apr 2021 14:00:34 +0200 Subject: [PATCH] move index.html into example folder --- xayn-ai-ffi-wasm/README.md | 21 +++++++++++++-------- xayn-ai-ffi-wasm/data | 1 - xayn-ai-ffi-wasm/example/.gitignore | 2 ++ xayn-ai-ffi-wasm/{ => example}/index.html | 0 4 files changed, 15 insertions(+), 9 deletions(-) delete mode 120000 xayn-ai-ffi-wasm/data create mode 100644 xayn-ai-ffi-wasm/example/.gitignore rename xayn-ai-ffi-wasm/{ => example}/index.html (100%) diff --git a/xayn-ai-ffi-wasm/README.md b/xayn-ai-ffi-wasm/README.md index 444490a10..981d0fac6 100644 --- a/xayn-ai-ffi-wasm/README.md +++ b/xayn-ai-ffi-wasm/README.md @@ -5,18 +5,23 @@ - [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) - `rustup target add wasm32-unknown-unknown` -## Build +## Building the WASM module -`wasm-pack build` +``` +wasm-pack build +``` -## Test +## Running the WASM test -`wasm-pack test --node` +``` +wasm-pack test --node +``` -## Run in the browser +## Running the example -``` -ln -s $(pwd)/../data/ $(pwd)/data -wasm-pack build --target web --release +```shell +ln -s $(pwd)/../data/ $(pwd)/example/data +wasm-pack build --target web --release --no-typescript --out-dir example/pkg +cd example python3 -m http.server ``` diff --git a/xayn-ai-ffi-wasm/data b/xayn-ai-ffi-wasm/data deleted file mode 120000 index a663cfde5..000000000 --- a/xayn-ai-ffi-wasm/data +++ /dev/null @@ -1 +0,0 @@ -/Users/robert/projects/xayn-ai/xayn-ai-ffi-wasm/../data/ \ No newline at end of file diff --git a/xayn-ai-ffi-wasm/example/.gitignore b/xayn-ai-ffi-wasm/example/.gitignore new file mode 100644 index 000000000..55a0b3064 --- /dev/null +++ b/xayn-ai-ffi-wasm/example/.gitignore @@ -0,0 +1,2 @@ +/data +/pkg diff --git a/xayn-ai-ffi-wasm/index.html b/xayn-ai-ffi-wasm/example/index.html similarity index 100% rename from xayn-ai-ffi-wasm/index.html rename to xayn-ai-ffi-wasm/example/index.html