0
대규모 프로젝트의 경우 작은 프로젝트를 고유 한 빌드 프로세스로 자체 폴더로 분리하는 것이 좋습니다.상위 프로세스와 같이 생성 된 꿀풀 프로세스의 출력 형식
다음 설정은 기본적으로 Windows와 Mac에서 모두 작동합니다. 콘솔에서만 발생하는 자식 꿀꺽 프로세스의 결과는 부모 프로세스의 출력과 같지 않습니다.
var spawnCmd = require('spawn-cmd');
gulp.task('default', function() {
// Run all the parent projects tasks first
// ....
// ....
// ....
// When done, cd to child directory
process.chdir('./some-dir-that-has-a-gulpfile');
// Run `gulp` in the child directory
var child = spawnCmd.spawn('gulp', ['default']);
// And pipe the output to the current process
child.stdout.pipe(process.stdout);
});
내 질문은 일반 꿀꺽 과정과 정확히 같은 방식으로 자식 꿀꺽 프로세스의 출력을 표시하는 방법입니다.
편집 : Is it possible for child processes in Node.js to preserve colored output?
Windows와 Mac에서 완벽하게 작동했습니다. 감사! –