* Run a Node.js script in a child process, so that it can run in parallel with * the other tasks
(args: string[], cwd?: string)
| 218 | * the other tasks |
| 219 | */ |
| 220 | function runNodeScript(args: string[], cwd?: string) { |
| 221 | return new Promise<void>((resolve, reject) => { |
| 222 | const child = spawn(process.execPath, args, { cwd, stdio: "inherit" }); |
| 223 | child.on("error", reject); |
| 224 | child.on("close", (code, signal) => { |
| 225 | if (code === 0) { |
| 226 | resolve(); |
| 227 | } else { |
| 228 | const command = `node ${args.join(" ")}`; |
| 229 | reject( |
| 230 | new Error( |
| 231 | signal |
| 232 | ? `${command} was killed by ${signal}` |
| 233 | : `${command} exited with code ${code}` |
| 234 | ) |
| 235 | ); |
| 236 | } |
| 237 | }); |
| 238 | }); |
| 239 | } |
| 240 | |
| 241 | async function generateStandalone() { |
| 242 | log("Generating @babel/standalone files"); |
no test coverage detected