Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/web/analyze.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { spawn } from 'child_process';

// Bundle Analyzer 활성화
process.env.ANALYZE = 'true';

console.log('📊 Starting Next.js build with bundle analyzer...\n');

// next build 실행
const build = spawn('next', ['build'], {
stdio: 'inherit',
shell: true,
env: { ...process.env },
});

Copy link

Copilot AI Dec 7, 2025

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);
});
Suggested change
build.on('error', (err) => {
console.error('Failed to start build process:', err);
process.exit(1);
});

Copilot uses AI. Check for mistakes.
build.on('close', (code) => {
process.exit(code);
});
6 changes: 3 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"type": "module",
"scripts": {
"dev": "NEXT_PUBLIC_ENABLE_PROXY=false next dev",
"dev:https": "NEXT_PUBLIC_ENABLE_PROXY=true node server.mjs",
"dev": "next dev",
Copy link

Copilot AI Dec 7, 2025

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"

Copilot uses AI. Check for mistakes.
"dev:https": "node server.mjs",
"build": "next build",
"build:analyze": "ANALYZE=true next build",
"build:analyze": "node analyze.mjs",
"start": "next start",
"lint": "next lint",
"typecheck": "tsc --noEmit",
Expand Down
3 changes: 3 additions & 0 deletions apps/web/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

// HTTPS 모드에서는 프록시 활성화
process.env.NEXT_PUBLIC_ENABLE_PROXY = 'true';

const dev = process.env.NODE_ENV !== 'production';
const hostname = 'localhost';
const port = 3000;
Expand Down