diff --git a/.github/workflows/fe-cd.yml b/.github/workflows/fe-cd.yml index d67b2e4a..12c3ea1d 100644 --- a/.github/workflows/fe-cd.yml +++ b/.github/workflows/fe-cd.yml @@ -87,7 +87,7 @@ jobs: key: ${{ secrets.EC2_SSH_KEY }} script: | cd ~/app/frontend/dist/server - pnpm install --frozen-lockfile + pnpm install --prod # 배포 스크립트 실행 - name: Deploy diff --git a/frontend/apps/server/package.json b/frontend/apps/server/package.json index 3245848b..b19afd39 100644 --- a/frontend/apps/server/package.json +++ b/frontend/apps/server/package.json @@ -5,8 +5,8 @@ "main": "index.js", "type": "module", "scripts": { - "build": "tsup", - "start": "tsup --watch --onSuccess 'node dist/index.js'" + "build": "cross-env NODE_ENV=build tsup", + "start": "cross-env NODE_ENV=start tsup --watch" }, "dependencies": { "express": "^5.1.0" diff --git a/frontend/apps/server/tsconfig.json b/frontend/apps/server/tsconfig.json index 86074158..3e1b3a53 100644 --- a/frontend/apps/server/tsconfig.json +++ b/frontend/apps/server/tsconfig.json @@ -10,6 +10,6 @@ "outDir": "dist", "incremental": true }, - "include": ["src"], + "include": ["src", "*.config.ts"], "exclude": ["node_modules", "dist", "**/*.test.ts"] } \ No newline at end of file diff --git a/frontend/apps/server/tsup.config.ts b/frontend/apps/server/tsup.config.ts index 15f490e0..6ad88fea 100644 --- a/frontend/apps/server/tsup.config.ts +++ b/frontend/apps/server/tsup.config.ts @@ -1,8 +1,13 @@ +import process from 'node:process'; + import { nodeConfig } from '@endolphin/tsup-config'; import { defineConfig } from 'tsup'; +const isStart = process.env.NODE_ENV === 'start'; + export default defineConfig({ ...nodeConfig, dts: false, bundle: false, + onSuccess: isStart ? 'node dist/index.js' : undefined, });