-
Notifications
You must be signed in to change notification settings - Fork 2
Fix: proxy 환경 변수 분리 #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 }, | ||
| }); | ||
|
|
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스폰된 프로세스의 에러 핸들링이 누락되었습니다. 프로세스 실행 중 발생할 수 있는 에러를 처리해야 합니다:
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);
});| 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 성능 리포트
youdaeng2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
맥 살 걸 그랬네요.. 고생하셨습니다!
📌 개요
이번 PR에서 바뀐 내용을
한 줄혹은리스트로 요약해주세요.🗒 상세 설명
1. https모드와 http 모드를 사용할때 package.json에서 스크립트를 사용하지 않도록 했습니다.
2. build:analyze 를 개별 스크립트를 만들어서 윈도우 호환성을 개선했습니다.
📸 스크린샷
UI 변경이 있을 경우, Before / After 스크린샷을 첨부해주세요.
🔗 이슈
closes #95
✅ 체크리스트
[v] 코드가 스타일 가이드를 따릅니다
[v] 자체 코드 리뷰를 완료했습니다
[v] 복잡/핵심 로직에 주석을 추가했습니다
[v] 관심사 분리를 확인했습니다
[v] 잠재적 사이드이펙트를 점검했습니다
[] Vercel Preview로 테스트를 완료했습니다