Skip to content

Commit 5d8c0ba

Browse files
Don't optimize WASM binaries on CI during typecheck (#2689)
The `typecheck` step for playground-common depended on wasm-web build: ```json "@baml/playground-common#typecheck": { "dependsOn": ["@gloo-ai/baml-schema-wasm-web#build"] } ``` The build scripts called another script that ended up running `wasm-pack --release`, which has a very time-consuming optimization stage: ``` [INFO]: ⬇️ Installing wasm-bindgen... [INFO]: Optimizing wasm binaries with `wasm-opt`... [INFO]: ✨ Done in 4m 37s [INFO]: 📦 Your wasm pkg is ready to publish at ../web/dist. ``` This is not necessary for _typechecking_, we can run `--dev` instead of `--release`.
1 parent 18b3ceb commit 5d8c0ba

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

engine/baml-schema-wasm/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"clean": "git clean -xdf ./dist .turbo node_modules",
88
"comment": "don't use 'wasm pack --dev' below or it will be too big of a bundle and playground will be slow to load.",
99
"build": "pnpm run release",
10+
"typecheck": "pnpm run pack --dev",
1011
"release": "pnpm run pack --release",
1112
"pack": "wasm-pack build ../ --target bundler --out-dir ./web/dist"
1213
},

turbo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"env": ["SKIP_BAML_SRC_CHECK"]
7070
},
7171
"@baml/playground-common#typecheck": {
72-
"dependsOn": ["@gloo-ai/baml-schema-wasm-web#build"]
72+
"dependsOn": ["@gloo-ai/baml-schema-wasm-web#typecheck"]
7373
},
7474
"@baml/playground-common#dev": {
7575
"dependsOn": ["@gloo-ai/baml-schema-wasm-web#build"],

0 commit comments

Comments
 (0)