-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
36 lines (34 loc) · 1 KB
/
vite.config.ts
File metadata and controls
36 lines (34 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
export default defineConfig({
plugins: [react()],
base: './', // file:// 프로토콜에서 리소스를 찾기 위해 상대 경로 사용
root: 'renderer',
build: {
// 📦 Electron 패키징 시 main 번들과 같은 트리(dist-electron)에 렌더러 파일을 배치
// main.ts 의 __dirname 은 dist-electron/windows 이므로
// ../renderer/index.html, ../renderer/overlay.html 을 바라보게 맞춘다
outDir: '../dist-electron/renderer',
emptyOutDir: true,
rollupOptions: {
input: {
main: path.resolve(__dirname, 'renderer/index.html'),
overlay: path.resolve(__dirname, 'renderer/overlay.html'),
},
},
},
server: {
port: 5173,
strictPort: true,
// /overlay 라우트를 overlay.html로 매핑
fs: {
strict: false,
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './renderer/src'),
},
},
});