-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.mjs
More file actions
25 lines (21 loc) · 642 Bytes
/
build.mjs
File metadata and controls
25 lines (21 loc) · 642 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { resolve } from "path"
import { spawn } from "child_process"
const logData = (data) => {
console.log(data.toString());
};
const runVite = () => {
const vite = spawn("pnpm", ["run", "build"], { cwd: resolve("./packages/renderer") });
vite.stdout.on('data', logData);
vite.stderr.on('data', logData);
vite.on('close', (code) => {
if (code === 0) {
runTauri();
}
});
};
const runTauri = () => {
const tauri = spawn("cargo", ["tauri", "build"], { cwd: resolve("./packages/tauri_app") });
tauri.stdout.on('data', logData);
tauri.stderr.on('data', logData);
};
runVite();