| 509 | |
| 510 | // Launch the app in development mode. |
| 511 | export function launchApp( |
| 512 | dir: string, |
| 513 | port: string | number, |
| 514 | opts?: NextDevOptions |
| 515 | ) { |
| 516 | const options = opts ?? {} |
| 517 | const useTurbo = shouldUseTurbopack() |
| 518 | |
| 519 | return runNextCommandDev( |
| 520 | [ |
| 521 | useTurbo ? '--turbopack' : undefined, |
| 522 | dir, |
| 523 | '-p', |
| 524 | port as string, |
| 525 | '--hostname', |
| 526 | '::', |
| 527 | ].filter((flag: string | undefined): flag is string => Boolean(flag)), |
| 528 | undefined, |
| 529 | { ...options, turbo: useTurbo } |
| 530 | ) |
| 531 | } |
| 532 | |
| 533 | export function nextBuild( |
| 534 | dir: string, |