儲存庫
文件
API 參考
prune

turbo prune <範圍>...

針對目標工作空間產生具有精簡/部分單一儲存庫的精簡鎖定檔。

此指令會產生名為 out 的資料夾,其內部包含下列內容

  • 建置目標所需的所有內部工作區的完整原始碼
  • 新的精簡鎖定檔,其中僅包含原始根鎖定檔的精簡子集,以及精簡工作區中的工作區實際使用的相依性。
  • package.json 根目錄的副本
.                                 # Folder full source code for all workspaces needed to build the target
├── package.json                  # The root `package.json`
├── packages
│   ├── ui
│   │   ├── package.json
│   │   ├── src
│   │   │   └── index.tsx
│   │   └── tsconfig.json
│   ├── shared
│   │   ├── package.json
│   │   ├── src
│   │   │   ├── __tests__
│   │   │   │   ├── sum.test.ts
│   │   │   │   └── tsconfig.json
│   │   │   ├── index.ts
│   │   │   └── sum.ts
│   │   └── tsconfig.json
│   └── frontend
│       ├── next-env.d.ts
│       ├── next.config.js
│       ├── package.json
│       ├── src
│       │   └── pages
│       │       └── index.tsx
│       └── tsconfig.json
└── yarn.lock                            # The pruned lockfile for all targets in the subworkspace

選項

--docker

類型:布林值

預設為 false。傳遞此標記會變更精簡工作區的輸出資料夾,使其更易於搭配 Docker 最佳實務 / 層快取(在新分頁中開啟) 使用。

使用 --docker 標記時,prune 指令會產生名為 out 的資料夾,其內部包含下列內容

  • 包含已修剪工作區的 package.jsonjson 資料夾
  • 包含已修剪工作區完整原始碼的 full 資料夾,但僅包含建置目標所需的內部套件。
  • 新的修剪鎖定檔,其中僅包含原始根鎖定檔的修剪子集,以及已修剪工作區套件實際使用的相依性。
.
├── full                                # Folder full source code for all package needed to build the target
│   ├── package.json
│   └── packages
│       ├── ui
│       │   ├── package.json
│       │   ├── src
│       │   │   └── index.tsx
│       │   └── tsconfig.json
│       ├── shared
│       │   ├── package.json
│       │   ├── src
│       │   │   ├── __tests__
│       │   │   │   ├── sum.test.ts
│       │   │   │   └── tsconfig.json
│       │   │   ├── index.ts
│       │   │   └── sum.ts
│       │   └── tsconfig.json
│       └── frontend
│           ├── next-env.d.ts
│           ├── next.config.js
│           ├── package.json
│           ├── src
│           │   └── pages
│           │       └── index.tsx
│           └── tsconfig.json
├── json                                # Folder containing just package.jsons for all targets in the subworkspace
│   ├── package.json
│   └── packages
│       ├── ui
│       │   └── package.json
│       ├── shared
│       │   └── package.json
│       └── frontend
│           └── package.json
└── yarn.lock                           # The pruned lockfile for all targets in the subworkspace

--out-dir

預設值./out

自訂產生已修剪輸出的目錄。