Skip to content

Commit e31a25a

Browse files
committed
Allow customizing wizer path using opts.wizerBin
Fixes bytecodealliance#222
1 parent 54ab085 commit e31a25a

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,14 @@ AOT compilation can also be configured with the following options:
119119

120120
[weval]: https://github.com/bytecodealliance/weval
121121

122-
### Custom `weval` binary
122+
### Custom `weval` binary for AOT
123123

124124
To use a custom (pre-downloaded) [`weval`][weval] binary, set the `wevalBin` option to the path to your desired weval binary.
125125

126+
### Custom `wizer` binary when AOT is disabled
127+
128+
To use a custom (pre-downloaded) [`wizer`](https://github.com/bytecodealliance/wizer) binary, set the `wizerBin` option to the path to your desired wizer binary.
129+
126130
### Async Support
127131

128132
To support asynchronous operations, all functions may optionally be written as sync or async functions, even though they will always be turned into sync component functions.

src/componentize.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,14 @@ export async function componentize(opts,
292292
}
293293
);
294294
} else {
295+
let wizerBin;
296+
if (opts.wizerBin) {
297+
wizerBin = opts.wizerBin;
298+
} else {
299+
wizerBin = wizer;
300+
}
295301
wizerProcess = spawnSync(
296-
wizer,
302+
wizerBin,
297303
[
298304
'--allow-wasi',
299305
'--init-func',

types.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ interface ComponentizeOptions {
2727
* Use a pre-existing path to the `weval` binary, if present
2828
*/
2929
wevalBin?: string,
30+
/**
31+
* Use a pre-existing path to the `wizer` binary, if present
32+
*/
33+
wizerBin?: string,
3034
/**
3135
* Path to custom Preview2 Adapter
3236
*/

0 commit comments

Comments
 (0)