MCPcopy Create free account
hub / github.com/TanStack/cli / startAppDevServer

Method startAppDevServer

packages/cli/src/dev-watch.ts:497–529  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

495 }
496
497 private startAppDevServer(): void {
498 if (this.appDevProcess) {
499 return
500 }
501
502 const { command, args } = this.getDevCommandForPackageManager(
503 this.options.packageManager,
504 )
505
506 this.log.section('app dev server')
507 this.log.tree(' ', `starting: ${chalk.cyan([command, ...args].join(' '))}`)
508
509 this.appDevProcess = spawn(command, args, {
510 cwd: this.options.targetDir,
511 stdio: 'inherit',
512 shell: process.platform === 'win32',
513 env: process.env,
514 })
515
516 this.appDevProcess.on('exit', (code, signal) => {
517 if (signal) {
518 this.log.warning(`app dev server exited via signal ${signal}`)
519 } else if (code && code !== 0) {
520 this.log.warning(`app dev server exited with code ${code}`)
521 }
522 this.appDevProcess = null
523 })
524
525 this.appDevProcess.on('error', (error) => {
526 this.log.error(`Failed to start app dev server: ${error.message}`)
527 this.appDevProcess = null
528 })
529 }
530
531 private getDevCommandForPackageManager(packageManager: string): {
532 command: string

Callers 1

startMethod · 0.95

Calls 2

errorMethod · 0.80

Tested by

no test coverage detected