集成 Nuxt

Nuxt 是一个开源框架,使 Web 开发变得直观且强大。

快速开始

要在 Turborepo 中快速开始使用 Nuxt,可以使用 the with-vue-nuxt example

Terminal
npx create-turbo@latest -e with-vue-nuxt

将 Nuxt 应用程序添加到现有仓库

使用 Nuxi(Nuxt 的 CLI)在包中设置新的 Nuxt 应用程序。从仓库的根目录运行:

Terminal
npx nuxi@latest init apps/my-app

与你的仓库集成

要将内部包添加到你的新应用程序中,使用你的包管理器将它们安装到应用程序中:

./apps/my-app/package.json
{
 "name": "my-app",
  "dependencies": {
+   "@repo/ui": "*"
  }
}

确保运行你的包管理器的安装命令。你还可能需要更新 package.json 中的 scripts 以适应你的仓库用例。

自定义任务

默认情况下,新应用程序将使用根 turbo.json 中定义的任务。如果你想为新应用程序配置不同的任务,请使用包配置