-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #293 from krymtkts:feature/supress-react-logs
Update `build-md` task to use the wrapper script.
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { spawn } from "node:child_process"; | ||
|
||
const arg = process.argv[2]; | ||
console.log("Run App.fs.js with mode:", arg); | ||
|
||
const run = () => | ||
new Promise((resolve, reject) => { | ||
process.env.NODE_ENV = "production"; | ||
const child = spawn("node", ["./src/App.fs.js", arg]); | ||
|
||
child.stdout.on("data", (data) => { | ||
process.stdout.write(data); | ||
}); | ||
child.stderr.on("data", (data) => { | ||
process.stderr.write(data); | ||
}); | ||
child.on("close", (code) => { | ||
if (code !== 0) { | ||
reject(new Error(`Child process exited with code ${code}`)); | ||
} else { | ||
resolve(); | ||
} | ||
}); | ||
}); | ||
|
||
try { | ||
await run(); | ||
} catch (error) { | ||
console.error("Error running script:", error); | ||
exit(1); | ||
} |