File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,4 @@ RUN yarn install --production
3232
3333EXPOSE 5173
3434# 9. 서버 실행
35- CMD ["yarn", "dev "]
35+ CMD ["yarn", "prod "]
Original file line number Diff line number Diff line change 44 "version" : " 0.0.0" ,
55 "type" : " module" ,
66 "scripts" : {
7- "dev" : " vite --host 0.0.0.0" ,
7+ "dev" : " vite --host 0.0.0.0 --mode development" ,
8+ "prod" : " vite --host 0.0.0.0 --mode production" ,
89 "build" : " vite build" ,
910 "lint" : " eslint ." ,
1011 "preview" : " vite preview" ,
Original file line number Diff line number Diff line change @@ -3,7 +3,11 @@ import react from '@vitejs/plugin-react';
33import svgr from 'vite-plugin-svgr' ;
44import tsconfigPaths from 'vite-tsconfig-paths' ;
55
6- export default defineConfig ( {
6+
7+ export default defineConfig ( ( { mode } ) => ( {
8+ server : {
9+ hmr : mode !== 'production' , // 프로덕션 환경에서만 HMR 비활성화
10+ } ,
711 plugins : [
812 react ( ) ,
913 tsconfigPaths ( ) ,
@@ -16,4 +20,4 @@ export default defineConfig({
1620 outDir : '.dist'
1721 } ,
1822 cacheDir : '.vite'
19- } ) ;
23+ } ) )
You can’t perform that action at this time.
0 commit comments