Skip to content

Commit 2ffa63f

Browse files
committed
feat(schema-wasm): support environments other than Node.js
Previously we generated wasm-bindgen bindings for `@prisma/prisma-schema-wasm` with `--target nodejs`. This makes the generated glue code use Node.js `fs` module to load the WebAssembly module from disk and then instantiate it from an array of bytes. This commit change this to `--target bundler` which is what we use for `query-engine-wasm`. This makes wasm-bindgen use `import` statement to load the WebAssembly module instead. This is a breaking change, and requires updating Prisma CLI and language tools.
1 parent 9618390 commit 2ffa63f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prisma-schema-wasm/scripts/install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ cp ./prisma-schema-wasm/README.md "$out"/
3030

3131
printf '%s\n' " -> Generating node package"
3232
wasm-bindgen \
33-
--target nodejs \
33+
--target bundler \
3434
--out-dir "$out"/src \
3535
"target/wasm32-unknown-unknown/$TARGET_DIR/prisma_schema_build.wasm"

0 commit comments

Comments
 (0)