Merged
Conversation
There was a problem hiding this comment.
Pull request overview
이 PR은 Windows 환경에서의 호환성을 개선하기 위해 package.json 스크립트의 인라인 환경 변수를 별도 파일로 분리하는 작업입니다.
- HTTPS 개발 서버용 환경 변수를
server.mjs로 이동 - 번들 분석용 스크립트를 별도 파일(
analyze.mjs)로 분리 - package.json의 스크립트에서 플랫폼 의존적인 환경 변수 설정 제거
핵심 변경사항
새로운 파일 추가:
analyze.mjs: 번들 분석 빌드를 위한 독립 스크립트로,ANALYZE환경 변수를 설정하고 Next.js 빌드를 실행합니다.
사용법:
# HTTP 모드 (프록시 비활성화)
npm run dev
# HTTPS 모드 (프록시 활성화)
npm run dev:https
# 번들 분석
npm run build:analyzeReviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/web/server.mjs | HTTPS 개발 서버 실행 시 NEXT_PUBLIC_ENABLE_PROXY=true 환경 변수를 코드에서 설정하도록 추가 |
| apps/web/package.json | 스크립트에서 인라인 환경 변수 설정을 제거하여 크로스 플랫폼 호환성 개선 |
| apps/web/analyze.mjs | 번들 분석을 위한 독립 스크립트 파일 추가, ANALYZE 환경 변수를 설정하고 Next.js 빌드 실행 |
| "scripts": { | ||
| "dev": "NEXT_PUBLIC_ENABLE_PROXY=false next dev", | ||
| "dev:https": "NEXT_PUBLIC_ENABLE_PROXY=true node server.mjs", | ||
| "dev": "next dev", |
There was a problem hiding this comment.
dev 스크립트에서 NEXT_PUBLIC_ENABLE_PROXY 환경 변수가 설정되지 않았습니다. next.config.js의 로직에 따르면 이 변수가 설정되지 않으면 기본값이 true가 되어 프록시가 활성화됩니다.
기존 동작을 유지하려면 다음과 같이 별도의 스크립트 파일을 만들거나:
// dev.mjs
process.env.NEXT_PUBLIC_ENABLE_PROXY = 'false';
// next dev 실행 로직또는 cross-env 같은 크로스 플랫폼 도구를 사용하는 것을 권장합니다:
"dev": "cross-env NEXT_PUBLIC_ENABLE_PROXY=false next dev"| shell: true, | ||
| env: { ...process.env }, | ||
| }); | ||
|
|
There was a problem hiding this comment.
스폰된 프로세스의 에러 핸들링이 누락되었습니다. 프로세스 실행 중 발생할 수 있는 에러를 처리해야 합니다:
const build = spawn('next', ['build'], {
stdio: 'inherit',
shell: true,
env: { ...process.env },
});
build.on('error', (err) => {
console.error('Failed to start build process:', err);
process.exit(1);
});
build.on('close', (code) => {
process.exit(code);
});
Suggested change
| build.on('error', (err) => { | |
| console.error('Failed to start build process:', err); | |
| process.exit(1); | |
| }); |
📦 번들 분석 결과📊 번들 크기 요약
🔍 주요 청크 파일 (크기순)🤖 자동 생성된 번들 분석 리포트 |
⚡ Lighthouse 성능 분석 결과📊 전체 평균 점수
📈 측정 현황
📄 페이지별 상세 분석🏠 커뮤니티 페이지:
|
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 69점 |
| ♿ Accessibility | 78점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
👥 창업자 페이지: /main/founder
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 75점 |
| ♿ Accessibility | 87점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
🏡 홈 페이지: /main/home
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 75점 |
| ♿ Accessibility | 91점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
🗺️ 지도 페이지: /main/maps
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 75점 |
| ♿ Accessibility | 87점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
👤 프로필 페이지: /main/profile
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 75점 |
| ♿ Accessibility | 88점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
🔗 전체 상세 분석 결과
📄 측정된 페이지
- /main/community
- /main/founder
- /main/home
- /main/maps
- /main/profile
모든 페이지에서 성능 측정이 완료되었습니다.
🤖 자동 생성된 Lighthouse 성능 리포트
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 개요
이번 PR에서 바뀐 내용을
한 줄혹은리스트로 요약해주세요.🗒 상세 설명
1. https모드와 http 모드를 사용할때 package.json에서 스크립트를 사용하지 않도록 했습니다.
2. build:analyze 를 개별 스크립트를 만들어서 윈도우 호환성을 개선했습니다.
📸 스크린샷
UI 변경이 있을 경우, Before / After 스크린샷을 첨부해주세요.
🔗 이슈
closes #95
✅ 체크리스트
[v] 코드가 스타일 가이드를 따릅니다
[v] 자체 코드 리뷰를 완료했습니다
[v] 복잡/핵심 로직에 주석을 추가했습니다
[v] 관심사 분리를 확인했습니다
[v] 잠재적 사이드이펙트를 점검했습니다
[] Vercel Preview로 테스트를 완료했습니다