forked from entrepeneur4lyf/Web-Audio-Mastering
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
49 lines (45 loc) · 1.16 KB
/
vite.config.js
File metadata and controls
49 lines (45 loc) · 1.16 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { defineConfig } from 'vite';
import electron from 'vite-plugin-electron/simple';
import { resolve } from 'path';
const rootDir = __dirname;
export default defineConfig(({ command }) => ({
// Use web/ as the single source of truth for the renderer
root: 'web',
// Build with relative asset paths so the same output works for:
// - GitHub Pages (/repo/)
// - Electron loadFile() (file://.../dist/index.html)
base: command === 'build' ? './' : '/',
plugins: [
electron({
main: {
entry: resolve(rootDir, 'electron/main.js'),
vite: {
build: {
outDir: resolve(rootDir, 'dist-electron'),
},
},
},
preload: {
input: resolve(rootDir, 'electron/preload.js'),
vite: {
build: {
outDir: resolve(rootDir, 'dist-electron'),
},
},
},
}),
],
build: {
outDir: resolve(rootDir, 'dist'),
emptyOutDir: true
},
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp'
}
},
optimizeDeps: {
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util']
}
}));