Double turbo statistics output during pnpm build execution
## Issue Description
When running `pnpm build`, the turbo statistics appear twice in the output:
```
Tasks: 11 successful, 11 total
Cached: 0 cached, 11 total
Time: 1.902s
turbo 2.5.3
Tasks: 20 successful, 20 total
Cached: 0 cached, 20 total
Time: 14.786s
```
## Root Cause Analysis
The build script in `package.json` chains two commands:
```json
"build": "pnpm set-global-env && pnpm base-build"
```
This causes:
1. **First output (11 tasks, ~1.9s)**: `pnpm set-global-env` triggers turbo tasks due to `globalEnv` and `globalDependencies` configuration in `turbo.json`
2. **Second output (20 tasks, ~14.7s)**: `pnpm base-build` executes the actual build via `turbo build`
## Current Configuration
**turbo.json:**
```json
{
"globalEnv": ["CEB_*", "CLI_CEB_*"],
"globalDependencies": [".env"],
"tasks": {
"build": {
"dependsOn": ["ready", "^build"],
"outputs": ["../../dist/**", "dist/**"],
"cache": false
}
}
}
```
**package.json:**
```json
{
"scripts": {
"set-global-env": "bash bash-scripts/set_global_env.sh",
"base-build": "pnpm clean:bundle && turbo build --ui=stream",
"build": "pnpm set-global-env && pnpm base-build"
}
}
```
## Questions for Consideration
1. Is this double output the intended behavior?
2. Could we optimize the script chain to show a single consolidated output?
3. Should `set-global-env` be integrated as a pre-build step within turbo tasks instead of a separate pnpm script?
## Environment
- Turbo version: 2.5.3
- Package manager: pnpm@10.11.0
- Node version: >=18.0.0
## Notes
This is not a blocking issue - the build process works correctly. This issue is filed for future research and potential optimization.
1 条评论