diff --git a/Dockerfile b/Dockerfile index f6196e73..707e931f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ make \ openssl \ libssl-dev \ - clang + clang \ + lld WORKDIR /scratch COPY script/wasm-deps.sh . @@ -19,6 +20,7 @@ RUN chmod a+x ./wasm-deps.sh && sleep 1 && ./wasm-deps.sh WORKDIR /app COPY Cargo.toml Cargo.lock rust-toolchain ./ +ENV CARGO_NET_GIT_FETCH_WITH_CLI=true RUN cargo install wasm-pack COPY . . diff --git a/plume-api/Cargo.toml b/plume-api/Cargo.toml index 3d608b63..56e52f9b 100644 --- a/plume-api/Cargo.toml +++ b/plume-api/Cargo.toml @@ -7,3 +7,6 @@ edition = "2018" [dependencies] serde = "1.0" serde_derive = "1.0" + +[package.metadata.wasm-pack.profile.release] +wasm-opt = false diff --git a/plume-cli/Cargo.toml b/plume-cli/Cargo.toml index deed153d..f13de003 100644 --- a/plume-cli/Cargo.toml +++ b/plume-cli/Cargo.toml @@ -24,3 +24,6 @@ path = "../plume-models" postgres = ["plume-models/postgres", "diesel/postgres"] sqlite = ["plume-models/sqlite", "diesel/sqlite"] search-lindera = ["plume-models/search-lindera"] + +[package.metadata.wasm-pack.profile.release] +wasm-opt = false diff --git a/plume-common/Cargo.toml b/plume-common/Cargo.toml index f1ad8a8d..2622a50f 100644 --- a/plume-common/Cargo.toml +++ b/plume-common/Cargo.toml @@ -40,3 +40,6 @@ assert-json-diff = "2.0.1" once_cell = "1.12.0" [features] + +[package.metadata.wasm-pack.profile.release] +wasm-opt = false diff --git a/plume-front/Cargo.toml b/plume-front/Cargo.toml index 27d936d1..da8a41f3 100644 --- a/plume-front/Cargo.toml +++ b/plume-front/Cargo.toml @@ -50,3 +50,6 @@ features = [ 'TouchEvent', 'Window' ] + +[package.metadata.wasm-pack.profile.release] +wasm-opt = false diff --git a/plume-macro/Cargo.toml b/plume-macro/Cargo.toml index 07dd2d28..d5a90a8d 100644 --- a/plume-macro/Cargo.toml +++ b/plume-macro/Cargo.toml @@ -19,3 +19,6 @@ syn = "0.15.27" default = [] postgres = [] sqlite = [] + +[package.metadata.wasm-pack.profile.release] +wasm-opt = false diff --git a/script/plume-front.sh b/script/plume-front.sh index 63b2f5dd..ead3ad50 100755 --- a/script/plume-front.sh +++ b/script/plume-front.sh @@ -21,7 +21,7 @@ EOF if [ $ARCH == "aarch64" -o $ARCH == "armv71" ] ; then export PATH=/opt/local/llvm/bin:${PATH} cd /app - RUSTFLAGS="-C linker=lld" wasm-pack build --target web --release plume-front + RUSTFLAGS="--cfg=web_sys_unstable_apis" wasm-pack build --target web --release plume-front else wasm-pack build --target web --release plume-front fi