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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"start": "vite",
"build": "tsc -b && vite build",
"build:analyze:staging": "ANALYZE=true tsc -b && ANALYZE=true vite build --mode staging",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# .env.staging 파일 존재 여부 확인
fd -t f '.env.staging' --max-depth 1

# 또는 .env 관련 파일 목록 확인
ls -la .env* 2>/dev/null || echo "No .env files found in root"

Repository: BCSDLab/KONECT_FRONT_END

Length of output: 95


🏁 Script executed:

# 1. .env.example 파일 확인
fd -t f '.env.example' 

# 2. package.json에서 cross-env 존재 여부 확인
grep -E '"cross-env"|dependencies|devDependencies' package.json | head -20

# 3. src/apis/client.ts에서 VITE_API_PATH 사용 확인
fd -t f 'client.ts' src/apis/ && cat src/apis/client.ts | grep -A 5 -B 5 'VITE_API_PATH'

Repository: BCSDLab/KONECT_FRONT_END

Length of output: 507


🏁 Script executed:

# .env.example 파일 내용 확인
cat .env.example

# package.json의 전체 scripts와 devDependencies 확인
cat package.json | head -60

Repository: BCSDLab/KONECT_FRONT_END

Length of output: 1763


크로스 플랫폼 호환성을 위해 cross-env 사용 필수

ANALYZE=true 문법은 Windows에서 동작하지 않습니다. cross-env 패키지를 devDependencies에 추가하고 적용해야 합니다.

또한 --mode staging 사용 시 필요한 .env.staging 파일이 없고, 더 중요하게는 src/apis/client.ts에서 필수로 요구하는 VITE_API_PATH 환경변수를 정의할 .env.example 파일이 존재하지 않습니다.

♻️ 수정 예시

1. cross-env 적용

-    "build:analyze:staging": "ANALYZE=true tsc -b && ANALYZE=true vite build --mode staging",
+    "build:analyze:staging": "cross-env ANALYZE=true tsc -b && cross-env ANALYZE=true vite build --mode staging",

2. devDependencies에 cross-env 추가

+    "cross-env": "^7.0.3",

3. .env.example 생성 (프로젝트 루트)

VITE_API_PATH=http://localhost:3000/api
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 10, Update package.json to use cross-env for
cross-platform environment variables by adding cross-env to devDependencies and
changing the "build:analyze:staging" script to prefix ANALYZE=true with
cross-env (i.e., "cross-env ANALYZE=true ..."); ensure you add a .env.example at
project root containing VITE_API_PATH (e.g.,
VITE_API_PATH=http://localhost:3000/api) because src/apis/client.ts expects
VITE_API_PATH; also add or document a .env.staging file (or ensure .env.staging
is created) for the --mode staging build so the build has the required staging
env vars.

"lint": "eslint .",
"preview": "vite preview"
},
Expand Down Expand Up @@ -42,6 +43,7 @@
"globals": "^16.5.0",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.7.1",
"rollup-plugin-visualizer": "^7.0.1",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.4",
"vite": "^7.2.4",
Expand Down
Loading
Loading