Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ AOT compilation can also be configured with the following options:

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

### Custom `weval` binary
### Custom `weval` binary for AOT

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

### Custom `wizer` binary when AOT is disabled

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.

### Async Support

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.
Expand Down
8 changes: 7 additions & 1 deletion src/componentize.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,14 @@ export async function componentize(opts,
}
);
} else {
let wizerBin;
if (opts.wizerBin) {
wizerBin = opts.wizerBin;
} else {
wizerBin = wizer;
}
wizerProcess = spawnSync(
wizer,
wizerBin,
[
'--allow-wasi',
'--init-func',
Expand Down
4 changes: 4 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ interface ComponentizeOptions {
* Use a pre-existing path to the `weval` binary, if present
*/
wevalBin?: string,
/**
* Use a pre-existing path to the `wizer` binary, if present
*/
wizerBin?: string,
/**
* Path to custom Preview2 Adapter
*/
Expand Down