mirror of
https://github.com/speice-io/isomorphic-rust
synced 2025-07-02 06:16:12 -04:00
Synchronize, not sure how much is or isn't working
This commit is contained in:
3
electron_percy_wasm/.gitignore
vendored
3
electron_percy_wasm/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
node_modules/
|
||||
Cargo.lock
|
||||
target/
|
||||
target/
|
||||
dist/
|
@ -3,6 +3,9 @@ name = "electron_percy_wasm"
|
||||
version = "0.1.0"
|
||||
authors = ["Bradlee Speice <bradlee@speice.io>"]
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
percy-webapis = "0.0.1"
|
||||
virtual-dom-rs = "0.1"
|
||||
|
4
electron_percy_wasm/app/.gitignore
vendored
4
electron_percy_wasm/app/.gitignore
vendored
@ -1,4 +0,0 @@
|
||||
*.wasm
|
||||
*.bundle.js
|
||||
bundle.js
|
||||
electron_percy_wasm.js
|
@ -1,11 +1,12 @@
|
||||
DIR="$(dirname $0)"
|
||||
WASM_DIR="$DIR/target/wasm32-unknown-unknown"
|
||||
WASM_NAME="$(cat "$DIR/Cargo.toml" | grep name | sed 's/name = "//' | sed 's/"//g')"
|
||||
APP_DIR="$DIR/app/"
|
||||
APP_DIR="$DIR/dist/"
|
||||
|
||||
if [ ! -d "$APP_DIR" ]; then
|
||||
mkdir "$APP_DIR"
|
||||
fi
|
||||
cp "$DIR/static/"* "$APP_DIR"
|
||||
|
||||
if [ -z "$(which cargo)" ]; then
|
||||
echo 'Must install `cargo` before proceeding. Please see https://rustup.rs/ for more information.'
|
||||
@ -20,6 +21,5 @@ fi
|
||||
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"
|
||||
# Necessitated by https://github.com/webpack/webpack/issues/7918
|
||||
sed -i '/.*instantiateStreaming.*/d' "$APP_DIR/bundle.js"
|
||||
"$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"
|
@ -3,9 +3,9 @@
|
||||
"productName": "electron_percy_wasm",
|
||||
"version": "1.0.0",
|
||||
"description": "My Electron application description",
|
||||
"main": "app/index.js",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"prestart": "./build_wasm_bundle.sh",
|
||||
"prestart": "./build.sh",
|
||||
"start": "electron-forge start",
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make",
|
||||
|
Reference in New Issue
Block a user