38 lines
1.1 KiB
TypeScript
Executable File
38 lines
1.1 KiB
TypeScript
Executable File
import { fileURLToPath } from 'url';
|
|
import { dirname, resolve } from 'path';
|
|
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
export default defineConfig({
|
|
server: {
|
|
port: 3000,
|
|
host: '0.0.0.0',
|
|
// 도커 컨테이너가 Windows 바인드 마운트를 감시할 때 inotify 이벤트가 오지 않아
|
|
// HMR 이 전혀 동작하지 않는다(호스트에서 파일을 고쳐도 옛 모듈을 계속 서빙).
|
|
// 2026-08-26 실측: 1시간 편집에 HMR 이벤트 0건 → 폴링으로 전환.
|
|
watch: {
|
|
usePolling: true,
|
|
interval: 500,
|
|
},
|
|
},
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, './src'),
|
|
}
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
// JS/CSS 파일에 해시 추가 (캐시 버스팅)
|
|
entryFileNames: 'assets/[name].[hash].js',
|
|
chunkFileNames: 'assets/[name].[hash].js',
|
|
assetFileNames: 'assets/[name].[hash].[ext]'
|
|
}
|
|
}
|
|
}
|
|
});
|