App Hosting에서 모노레포 사용
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
모노레포를 사용하면 단일 디렉터리에서 여러 프로젝트를 정리하고 관리할 수 있습니다. 이 가이드에서는 App Hosting를 사용하여 Nx 기반 앱을 배포하는 방법을 설명합니다.
Firebase Console로 모노레포 배포
모노레포 지원은 Firebase Console의 그래픽 백엔드 설정 흐름에 내장되어 있습니다. '배포 설정'에서 '루트 디렉터리'를 묻는 메시지가 표시되면 모노레포 내에서 배포하려는 애플리케이션의 경로를 지정합니다.

Firebase CLI로 모노레포 배포
모노레포 지원은 Firebase CLI 명령어 apphosting:backends:create
로 호출되는 백엔드 설정 흐름에 내장되어 있습니다. 이 흐름을 입력하고 선택한 GitHub 저장소를 지정하면 저장소를 기준으로 앱의 루트 디렉터리를 지정하라는 메시지가 표시됩니다. 이 메시지에서 모노리포 내에 배포하려는 애플리케이션의 경로를 전달합니다.
$ firebase apphosting:backends:create --project [project-name]
i === Import a GitHub repository
✔ Connected with GitHub successfully
? Which GitHub repo do you want to deploy? gh-username/nx-monorepo
? Specify your app's root directory relative to your repository path/to/app
예를 들어 다음 Nx 프로젝트 구조와 빌드 및 배포하려는 애플리케이션인 'target-app'이 주어지면 배포되는 애셋은 다음과 같습니다.
.
├── lib
├── apps
│ └── target-app
│ ├── project.json
│ └── src
│ └── ...
├── nx.json
├── package-lock.json
└── package.json
저장소를 기준으로 한 앱의 루트 디렉터리는 apps/target-app
입니다.
모노레포 배포 문제 해결
- '루트 디렉터리' 필드를 지정하지 않으면 빌드가 실패하고 App Hosting가 Nx 모노리포 내에서 타겟팅할 프로젝트를 찾을 수 없다는 메시지가 표시됩니다.
- Nx + Angular 애플리케이션의 경우 Angular 애플리케이션 빌더를 사용하여 애플리케이션을 빌드해야 합니다. Angular 애플리케이션 빌더는
project.json
에 지정됩니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-20(UTC)
[null,null,["최종 업데이트: 2025-08-20(UTC)"],[],[],null,["\u003cbr /\u003e\n\nWith monorepos, you can organize and manage multiple projects in a single\ndirectory. This guide describes how to get started deploying Nx-based apps with\nApp Hosting.\n\nDeploy monorepos with the Firebase console\n\nMonorepo support is built into the graphical backend setup flow in the Firebase\nconsole. When prompted for a \"Root directory\" under \"Deployment settings,\"\nspecify the path to the application you want to deploy inside the monorepo:\n\nDeploy monorepos with the Firebase CLI\n\nMonorepo support is built into the backend setup flow invoked by the Firebase\nCLI command `apphosting:backends:create`. After you enter this flow and specify\nyour chosen GitHub repository, you are prompted to specify your app's root\ndirectory relative to your repository; at this prompt, pass the path to the\napplication you want to deploy inside the monorepo: \n\n $ firebase apphosting:backends:create --project [project-name]\n i === Import a GitHub repository\n ✔ Connected with GitHub successfully\n\n ? Which GitHub repo do you want to deploy? gh-username/nx-monorepo\n ? Specify your app's root directory relative to your repository path/to/app\n\nFor example, here are the assets that would be deployed given the following Nx\nproject structure and \"target-app\" as the application you want to build and\ndeploy: \n\n .\n ├── lib\n ├── apps\n │ └── target-app\n │ ├── project.json\n │ └── src\n │ └── ...\n ├── nx.json\n ├── package-lock.json\n └── package.json\n\nThe app's root directory relative to your repository is `apps/target-app`.\n\nTroubleshooting monorepo deployment\n\n- If you do not specify the \"root directory\" field, then the build will fail and display a message that App Hosting cannot find a project to target inside the Nx monorepo.\n- For Nx + Angular applications, you must use the [Angular application\n builder](https://angular.io/guide/esbuild) to build the application. The Angular application builder is specified in `project.json`"]]