Skip to content

Commit

Permalink
Removed the pkg folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Asger committed Feb 19, 2019
1 parent 11db2c1 commit be56d13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@
.idea
ss

/examples/web/target/
/examples/web/www/node_modules/
/examples/web/www/pkg/

# Web generated files
*.data
*.html.map
*.wasm
*.wasm.map
*.wast
*.log
*.js

# Generated by Cargo
# will have compiled files and executables
/target/
/examples/web/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
8 changes: 4 additions & 4 deletions examples/web/build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ -z "$RELEASE" ]; then
echo "Development build"

RUST_BACKTRACE=1 cargo +nightly build --target wasm32-unknown-unknown --release
wasm-bindgen ./target/wasm32-unknown-unknown/release/hello_world_web.wasm --out-dir ./www/pkg/ --no-typescript --no-modules
wasm-bindgen ./target/wasm32-unknown-unknown/release/hello_world_web.wasm --out-dir ./www/ --no-typescript --no-modules

# RELEASE=1 ./build.sh
else
Expand All @@ -21,7 +21,7 @@ else
echo "Release build"

cargo +nightly build --target wasm32-unknown-unknown --release &&
wasm-bindgen ./target/wasm32-unknown-unknown/release/hello_world_web.wasm --out-dir ./www/pkg/ --no-typescript --no-modules &&
wasm-opt -O3 -o ./www/pkg/optimized.wasm ./www/pkg/hello_world_web_bg.wasm &&
mv ./www/pkg/optimized.wasm ./www/pkg/hello_world_web_bg.wasm
wasm-bindgen ./target/wasm32-unknown-unknown/release/hello_world_web.wasm --out-dir ./www/ --no-typescript --no-modules &&
wasm-opt -O3 -o ./www/optimized.wasm ./www/hello_world_web_bg.wasm &&
mv ./www/optimized.wasm ./www/hello_world_web_bg.wasm
fi
4 changes: 2 additions & 2 deletions examples/web/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
</head>
<body>
<canvas id="canvas" height="720" width="1280" />
<script src='/pkg/hello_world_web.js'></script>
<script src='/hello_world_web.js'></script>
<script>
window.addEventListener('load', function () {
window.wasm_bindgen('/pkg/hello_world_web_bg.wasm')
window.wasm_bindgen('/hello_world_web_bg.wasm')
})
</script>
</body>
Expand Down

0 comments on commit be56d13

Please sign in to comment.