Skip to content

Commit

Permalink
refactor: vite mode 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeeeeeh committed Nov 13, 2024
1 parent 6c5425b commit ddbef30
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ RUN yarn install --production

EXPOSE 5173
# 9. 서버 실행
CMD ["yarn", "dev"]
CMD ["yarn", "prod"]
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --host 0.0.0.0",
"dev": "vite --host 0.0.0.0 --mode development",
"prod": "vite --host 0.0.0.0 --mode production",
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview",
Expand Down
8 changes: 6 additions & 2 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths';

export default defineConfig({

export default defineConfig(({ mode }) => ({
server: {
hmr: mode !== 'production', // 프로덕션 환경에서만 HMR 비활성화
},
plugins: [
react(),
tsconfigPaths(),
Expand All @@ -16,4 +20,4 @@ export default defineConfig({
outDir: '.dist'
},
cacheDir: '.vite'
});
}))

Check failure on line 23 in frontend/vite.config.ts

View workflow job for this annotation

GitHub Actions / build (frontend)

Missing semicolon

0 comments on commit ddbef30

Please sign in to comment.