Add infrastructure to build and publish as wasm32 (#3840)

Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
This commit is contained in:
Lovell Fuller
2023-11-09 14:46:07 +00:00
committed by GitHub
parent 475bf16b09
commit a8f68ba7f0
17 changed files with 241 additions and 20 deletions

View File

@@ -59,11 +59,17 @@ let versions = {
};
/* istanbul ignore next */
if (!libvipsVersion.isGlobal) {
try {
versions = require(`@img/sharp-${runtimePlatform}/versions`);
} catch (_) {
if (!libvipsVersion.isWasm) {
try {
versions = require(`@img/sharp-libvips-${runtimePlatform}/versions`);
versions = require(`@img/sharp-${runtimePlatform}/versions`);
} catch (_) {
try {
versions = require(`@img/sharp-libvips-${runtimePlatform}/versions`);
} catch (_) {}
}
} else {
try {
versions = require('@img/sharp-wasm32/versions');
} catch (_) {}
}
}