Skip to content

Commit 2b7755e

Browse files
authored
fix: umi ui no ipc default (umijs#3373)
1 parent 2e653ef commit 2b7755e

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

packages/umi-ui-tasks/src/server/core/Tasks/Dev.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@ export class DevTask extends BaseTask {
2626
const analyzeEnv = await getDevAnalyzeEnv();
2727
this.analyzePort = analyzeEnv.ANALYZE_PORT;
2828

29-
this.proc = await runCommand(script, {
30-
cwd: this.cwd,
31-
env: {
32-
...env, // 前端 env
33-
...analyzeEnv, // analyze env
34-
...scriptEnvs, // script 解析到的
29+
this.proc = await runCommand(
30+
script,
31+
{
32+
cwd: this.cwd,
33+
env: {
34+
...env, // 前端 env
35+
...analyzeEnv, // analyze env
36+
...scriptEnvs, // script 解析到的
37+
},
3538
},
36-
});
39+
true,
40+
);
3741

3842
this.handleChildProcess(this.proc);
3943
}

packages/umi-ui-tasks/src/server/util/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ export const error = (msg: string, name = 'TaskError') => {
99
throw err;
1010
};
1111

12-
export const runCommand = (script: string, options: SpawnOptions = {}) => {
12+
export const runCommand = (script: string, options: SpawnOptions = {}, ipc = false) => {
1313
options.env = {
1414
...process.env,
1515
...options.env,
1616
FORCE_COLOR: '1',
1717
};
1818

1919
options.cwd = options.cwd || process.cwd();
20-
options.stdio = [null, null, null, 'ipc'];
20+
options.stdio = ipc ? [null, null, null, 'ipc'] : [null, null, null];
2121

2222
let sh = 'sh';
2323
let shFlag = '-c';

0 commit comments

Comments
 (0)