Install wasm-pack from cargo for Windows ARM compat

This commit is contained in:
Gregory Schier
2025-11-28 06:04:48 -08:00
parent 2ddb1096df
commit 07f4696a2c
5 changed files with 40 additions and 220 deletions

View File

@@ -0,0 +1,18 @@
const { execSync } = require('node:child_process');
const version = tryExecSync('wasm-pack --version');
if (version.startsWith('wasm-pack ')) {
console.log('wasm-pack already installed');
return;
}
console.log('Installing wasm-pack via cargo...');
execSync('cargo install wasm-pack', { stdio: 'inherit' });
function tryExecSync(cmd) {
try {
return execSync(cmd, { stdio: 'pipe' }).toString('utf-8');
} catch (_) {
return '';
}
}