Skip to content

Commit 2fd495c

Browse files
authored
refactor: use cp.fork to preserve stdout for packages/extension build (#22926)
1 parent 91de9cf commit 2fd495c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

packages/extension/gulpfile.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import gulp from 'gulp'
22
import rimraf from 'rimraf'
33
import * as cypressIcons from '@packages/icons'
44
import cp from 'child_process'
5-
import util from 'util'
6-
const exec = util.promisify(cp.exec)
5+
import * as path from 'path'
6+
7+
const nodeWebpack = path.join(__dirname, '..', '..', 'scripts', 'run-webpack.js')
78

89
const clean = (done) => {
910
rimraf('dist', done)
@@ -15,7 +16,9 @@ const manifest = () => {
1516
}
1617

1718
const background = (cb) => {
18-
exec('node ../../scripts/run-webpack.js').then(() => cb()).catch(cb)
19+
cp.fork(nodeWebpack, { stdio: 'inherit' }).on('exit', (code) => {
20+
cb(code === 0 ? null : new Error(`Webpack process exited with code ${code}`))
21+
})
1922
}
2023

2124
const html = () => {

0 commit comments

Comments
 (0)