create-turbo

开始使用 Turborepo 最简单的方法是使用 create-turbo。使用此命令行工具快速开始构建新的 monorepo,所有设置均已为你设置好。

¥The easiest way to get started with Turborepo is by using create-turbo. Use this CLI tool to quickly start building a new monorepo, with everything set up for you.

Terminal
pnpm dlx create-turbo@latest

从示例开始

¥Start with an example

社区精心挑选了一组示例,展示如何在 Turborepo 中使用常用工具和库。要使用其中一个示例引导你的 monorepo,请使用 --example 标志:

¥The community curates a set of examples to showcase ways to use common tools and libraries with Turborepo. To bootstrap your monorepo with one of the examples, use the --example flag:

Terminal
pnpm dlx create-turbo@latest --example [example-name]

使用以下任意示例名称:

¥Use any of the example's names below:

核心维护示例

¥Core-maintained examples

以下示例由 Turborepo 核心团队维护。依赖会尽可能保持最新,并接受和处理这些示例的 GitHub Issue。

¥The following examples are maintained by the Turborepo core team. Dependencies are kept as up-to-date as possible and GitHub Issues are accepted and addressed for these examples.

NameDescription

社区维护的示例

¥Community-maintained examples

社区精心挑选了一组示例,展示如何在 Turborepo 中使用常用工具和库。要使用其中一个示例引导你的 monorepo,请使用 --example 标志:

¥The community curates a set of examples to showcase ways to use common tools and libraries with Turborepo. To bootstrap your monorepo with one of the examples, use the --example flag:

NameDescription

使用社区示例

¥Use a community example

你还可以使用 GitHub URL 来使用自定义启动器或示例。这对于使用你自己的自定义启动器或来自社区的示例非常有用。

¥You can also use a custom starter or example by using a GitHub URL. This is useful for using your own custom starters or examples from the community.

Terminal
pnpm dlx create-turbo@latest --example [github-url]

选项

¥Options

Terminal
-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