2025-10-04 11:02:27 +02:00
|
|
|
#!/usr/bin/env node
|
2025-12-27 16:14:54 +01:00
|
|
|
import { spawn } from "child_process";
|
2025-10-04 11:02:27 +02:00
|
|
|
import path from "path";
|
|
|
|
|
import { fileURLToPath } from "url";
|
2025-12-27 15:57:32 +01:00
|
|
|
|
2025-12-27 16:14:54 +01:00
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
const distPath = path.resolve(__dirname, "..", "dist");
|
|
|
|
|
const port = process.env.PORT || 1400;
|
2025-12-27 15:57:32 +01:00
|
|
|
|
2025-12-27 16:14:54 +01:00
|
|
|
const server = spawn("npx", ["serve", "-s", distPath, "-l", port.toString()], {
|
|
|
|
|
stdio: "inherit",
|
|
|
|
|
shell: process.platform === "win32",
|
|
|
|
|
});
|
2025-10-04 11:02:27 +02:00
|
|
|
|
2025-12-27 16:14:54 +01:00
|
|
|
process.on("SIGINT", () => {
|
|
|
|
|
server.kill();
|
|
|
|
|
process.exit();
|
2025-10-04 11:02:27 +02:00
|
|
|
});
|