Talon/ui/menu/.rollup/serve.js
ThetaDev 3562dc29d7
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
reformat js
2023-03-28 14:07:07 +02:00

20 lines
409 B
JavaScript

let server;
export function serve() {
function toExit() {
if (server) server.kill(0);
}
return {
writeBundle() {
if (server) return;
server = require("child_process").spawn("npm", ["run", "start", "--", "--dev"], {
stdio: ["ignore", "inherit", "inherit"],
shell: true,
});
process.on("SIGTERM", toExit);
process.on("exit", toExit);
},
};
}