This repository has been archived by the owner on May 15, 2021. It is now read-only.
/ isomorphic-rust Public archive
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
isomorphic-rust/percy/build.shGo to file
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
|WASM_NAME="$(cat "$DIR/Cargo.toml" | grep name | sed 's/name = "//' | sed 's/"//g')"|
|if [ ! -d "$APP_DIR" ]; then|
|cp "$DIR/static/"* "$APP_DIR"|
|if [ -z "$(which cargo)" ]; then|
|echo 'Must install `cargo` before proceeding. Please see https://rustup.rs/ for more information.'|
|if [ -z "$(which wasm-bindgen)" ]; then|
|echo "Installing wasm-bindgen-cli"|
|cargo install wasm-bindgen-cli|
|cargo +nightly build --target=wasm32-unknown-unknown && \|
|wasm-bindgen "$WASM_DIR/debug/$WASM_NAME.wasm" --out-dir "$APP_DIR" --no-typescript && \|
|# Have to use --mode=development so we can patch out the call to instantiateStreaming|
|"$DIR/node_modules/webpack-cli/bin/cli.js" --mode=development "$APP_DIR/app_loader.js" -o "$APP_DIR/bundle.js" && \|
|sed -i 's/.*instantiateStreaming.*//g' "$APP_DIR/bundle.js"|