From c6f9561de3dde44dd5dc0a3a1b61ba37fd04bca1 Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Sun, 18 Dec 2022 21:05:04 +0800 Subject: [PATCH] chore(ci): fix ci --- crates/loro-wasm/scripts/build.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/loro-wasm/scripts/build.ts b/crates/loro-wasm/scripts/build.ts index 4d4f6135..0904d6b0 100644 --- a/crates/loro-wasm/scripts/build.ts +++ b/crates/loro-wasm/scripts/build.ts @@ -7,8 +7,10 @@ const { __dirname } = __(import.meta); // deno run -A build.ts release web // deno run -A build.ts release nodejs let profile = "dev"; +let profileDir = "debug"; if (Deno.args[0] == "release") { profile = "release"; + profileDir = "release"; } const TARGETS = ["bundler", "web", "nodejs"]; const startTime = performance.now(); @@ -39,7 +41,8 @@ async function build() { } async function cargoBuild() { - const cmd = `cargo build --target wasm32-unknown-unknown --profile ${profile}`; + const cmd = + `cargo build --target wasm32-unknown-unknown --profile ${profile}`; console.log(cmd); const status = await Deno.run({ cmd: cmd.split(" "), @@ -73,7 +76,7 @@ async function buildTarget(target: string) { function genCommands(target: string): string[] { return [ - `wasm-bindgen --weak-refs --target ${target} --out-dir ${target} ../../target/wasm32-unknown-unknown/${profile}/loro_wasm.wasm`, + `wasm-bindgen --weak-refs --target ${target} --out-dir ${target} ../../target/wasm32-unknown-unknown/${profileDir}/loro_wasm.wasm`, ...(profile == "dev" ? [] : [ `wasm-opt -O4 ${target}/loro_wasm_bg.wasm -o ${target}/loro_wasm_bg.wasm`, ]),