Skip to content

fix: API 빌드 출력 경로 수정 및 gitignore 정리 - #387

Open
kimjihyo wants to merge 1 commit into
developfrom
fix/api-build-output-path
Open

fix: API 빌드 출력 경로 수정 및 gitignore 정리#387
kimjihyo wants to merge 1 commit into
developfrom
fix/api-build-output-path

Conversation

@kimjihyo

@kimjihyo kimjihyo commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator

🔸 작업 내용

  • @repo/types 경로를 src에서 dist로 변경하여 모듈 해석 충돌 해결
  • Dockerfile의 실행 경로를 dist/main.js로 수정
  • 빌드 아티팩트(migrations, types/src)를 gitignore에 추가
  • tsconfig.tsbuildinfo를 버전 관리에서 제거

🔸 참고

문제 상황

pnpm dev 실행 시 다음과 같은 에러가 발생했습니다:

Error: Cannot find module 'dist/main'

원인 분석

packages/types의 tsconfig에 composite: true 옵션이 설정되어 있어, TypeScript가 프로젝트 참조(Project References) 모드로 동작했습니다.

이 상태에서 API의 tsconfig.json에서 @repo/types를 소스 파일(packages/types/src)로 직접 참조하고 있었기 때문에:

  • TypeScript가 types 패키지의 소스 파일을 API 컴파일에 포함시키려 함
  • 빌드 출력 구조가 dist/main.js 대신 dist/apps/api/src/main.js로 생성됨
  • NestJS가 dist/main.js를 찾지 못해 실행 실패

해결 방법

  1. tsconfig.json 경로 수정: @repo/types를 소스(src) 대신 빌드된 결과물(dist)을 참조하도록 변경
"paths": {
  "@repo/types": ["../../packages/types/dist"]  // src → dist
}
  1. Dockerfile 실행 경로 수정: 빌드 출력 구조 변경에 맞춰 CMD 경로 업데이트
CMD ["node", "apps/api/dist/main.js"]  // 이전: dist/apps/api/src/main.js
  1. .gitignore 정리: 잘못된 위치에 생성된 빌드 아티팩트가 버전 관리에 포함되지 않도록 패턴 추가

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 생성된 증분 빌드 정보를 삭제하여 빌드 아티팩트 정리
    • 마이그레이션 및 컴파일 산출물에 대한 무시 규칙 추가
    • 컨테이너 시작 명령을 새 빌드 출력 경로에 맞게 조정
    • 타입 참조를 소스 대신 배포 산출물 경로로 해석하도록 빌드 구성 업데이트

참고: 사용자 기능에는 영향이 없으며 내부 빌드/배포 정리 작업입니다.

@coderabbitai

coderabbitai Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

TypeScript 빌드 아티팩트 삭제, .gitignore에 빌드 출력 무시 규칙 추가, apps/api의 Dockerfile 및 tsconfig.json에서 빌드 출력 경로 및 타입 패키지 경로를 dist로 변경하는 수정이 포함되어 있습니다.

Changes

Cohort / File(s) Summary
Build Artifact Removal
packages/types/tsconfig.tsbuildinfo
TypeScript 증분 빌드 메타데이터 파일 삭제 (파일 목록, 파일별 메타, 컴파일러 옵션 등 전부 제거).
Ignore rules
.gitignore
apps/api 마이그레이션 및 packages/types/src의 JS/비고타입/맵 산출물을 무시하도록 패턴 추가.
API Docker entrypoint
apps/api/Dockerfile
애플리케이션 시작 명령을 apps/api/dist/main.js로 변경하여 빌드 출력 경로와 일치시킴.
TypeScript config (API)
apps/api/tsconfig.json
@repo/types 경로 별칭을 ../../packages/types/dist로 변경하고 include/exclude 항목 추가 (소스→배포 경로로 참조 전환).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

BE, 🚨ASAP🚨

Suggested reviewers

  • rwaeng
  • swgivenchy
  • dltnwjd308

Poem

🐰 빌드 파일 하나 사라졌네,
깔끔한 숲길 반짝이네,
무시 규칙은 새로 달고,
출발점은 dist로 향하네,
당근 한 입, 커밋 축하해! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 주요 변경사항을 명확히 설명합니다. API 빌드 출력 경로 수정과 gitignore 정리라는 두 가지 핵심 변경사항을 간결하게 요약하고 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/api-build-output-path

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kimjihyo
kimjihyo marked this pull request as ready for review February 5, 2026 14:34

@AYEOOON AYEOOON left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!🙌

@rwaeng

rwaeng commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator

커밋 내역이 몇 개 빠진 것 같습니다..!

@kimjihyo

kimjihyo commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator Author

커밋 내역이 몇 개 빠진 것 같습니다..!

어 그러게요... ㅎㅎㅎ 이 따 집가서 커밋 수정 해놓을게여

- @repo/types 경로를 src에서 dist로 변경하여 모듈 해석 충돌 해결
- Dockerfile의 실행 경로를 dist/main.js로 수정
- 빌드 아티팩트(migrations, types/src)를 gitignore에 추가
- tsconfig.tsbuildinfo를 버전 관리에서 제거
@kimjihyo
kimjihyo force-pushed the fix/api-build-output-path branch from c06147e to 36e43ba Compare February 5, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants