Turborepo logo

create-turbo

開始使用 Turborepo 最簡單的方式是使用 create-turbo。使用此 CLI 工具可以快速開始建構新的 monorepo,所有設定都已為您準備就緒。

終端機
npx create-turbo@latest

從範例開始

社群策劃了一系列範例,展示如何將常見工具和程式庫與 Turborepo 一起使用。若要使用其中一個範例來引導啟動您的 monorepo,請使用 --example 標記

終端機
npx create-turbo@latest --example [example-name]

使用下方任何範例名稱

名稱描述
design-system透過跨多個應用程式共享設計系統,統一您網站的外觀和風格。
with-angular使用 Angular 的最小 Turborepo 範例。
with-berry使用 Yarn Berry 的最小 Turborepo 範例。
with-changesets預先配置為透過 Changesets 發佈套件的簡單 Next.js monorepo
with-docker具有 Express API 和 Next.js App 的 Monorepo,使用 Docker 部署並利用 turbo prune
with-gatsby具有 Gatsby.js 和 Next.js 應用程式的 Monorepo,兩者皆共享 UI 程式庫
with-nestjs使用 Nest.js 的最小 Turborepo 範例。
with-npm使用 npm 作為套件管理器的最小 Turborepo 範例。
with-prisma具有 Next.js App 的 Monorepo,已完整配置 Prisma
with-react-native-web具有共享 UI 程式庫的簡單 React Native 和 Next.js monorepo
with-rollup具有單一 Next.js 應用程式的 Monorepo,共享以 Rollup 捆綁的 UI 程式庫
with-typeorm具有 TypeORM 的 Monorepo
with-vite具有多個以 Vite 捆綁的 Vanilla JS 應用程式的 Monorepo,共享 UI 程式庫
with-vue-nuxt具有 Vue 和 Nuxt 的 Monorepo,共享 UI 程式庫
with-yarn使用 Yarn 1 進行套件管理的 Monorepo

使用社群範例

您也可以使用 GitHub URL 來使用自訂的 starter 或範例。這對於使用您自己的自訂 starter 或社群範例非常有用。

終端機
npx create-turbo@latest --example [github-url]

選項

終端機
-m, --package-manager to use (choices: "npm", "yarn", "pnpm", "bun")

--skip-install: Do not run a package manager install after creating the project (Default: false)

--skip-transforms: Do not run any code transformation after creating the project (Default: false)

--turbo-version <version>: Use a specific version of turbo (default: latest)

-e, --example [name]|[github-url]: An example to bootstrap the app with. You can use an example name from the official Turborepo repo or a GitHub URL. The URL can use any branch and/or subdirectory

-p, --example-path <path-to-example>: In a rare case, your GitHub URL might contain a branch name with a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar). In this case, you must specify the path to the example separately: --example-path foo/bar

-v, --version:  Output the current version

-h, --help: Display help for command

小時

總計節省的運算時間
開始使用
遠端快取 →

本頁面