Files
LiveSplitOne/buildCore.js
T
Christopher Serr e920821158 Remove Makefile and switch to Node Script
This gets rid of the need to use make and thus a unix like shell. You
can now just run `npm run build:core` instead.

Closes #87
2018-05-14 16:46:01 +02:00

34 lines
712 B
JavaScript

const { spawnSync } = require('child_process');
const fs = require('fs');
spawnSync(
"cargo",
["run"],
{
cwd: "livesplit-core/capi/bind_gen",
stdio: "inherit",
}
);
fs
.createReadStream("livesplit-core/capi/bindings/wasm/livesplit_core.ts")
.pipe(fs.createWriteStream("src/livesplit.ts"));
spawnSync(
"cargo",
[
"build",
"-p", "cdylib",
"--target", "wasm32-unknown-unknown",
"--release",
],
{
cwd: "livesplit-core",
stdio: "inherit",
}
);
fs
.createReadStream("livesplit-core/target/wasm32-unknown-unknown/release/livesplit_core.wasm")
.pipe(fs.createWriteStream("src/livesplit_core.wasm"));