wasm-pack-plugin
wasm-pack-plugin copied to clipboard
Install wasm-pack via installer if available for platform
trafficstars
It will be a lot faster to install if we don't force users to compile it from scratch :laughing:
It would be something like this:
_checkWasmPack() {
info('🧐 Checking for wasm-pack...\n');
if (commandExistsSync('wasm-pack')) {
info('✅ wasm-pack is installed. \n');
return Promise.resolve();
} else {
info('ℹ️ Installing wasm-pack \n');
switch (process.platform) {
case 'darwin':
case 'freebsd':
case 'linux':
case 'openbsd':
// TODO: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
case 'win32':
// TODO: Download + execute https://github.com/rustwasm/wasm-pack/releases/download/v0.5.1/wasm-pack-init.exe
default:
return runProcess('cargo', ['install', 'wasm-pack'], {});
}
}
}
We could use GitHub's API to download the latest binary for the OS and if it doesn't exist build it.