-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.mjs
More file actions
41 lines (39 loc) · 1.38 KB
/
vite.config.mjs
File metadata and controls
41 lines (39 loc) · 1.38 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const DEV_SERVER_HOST = '127.0.0.1';
const DEV_SERVER_PORT = 36598;
export default defineConfig(() => {
return {
plugins: [react(), tailwindcss()],
envDir: __dirname,
base: './',
root: path.resolve(__dirname, './src/renderer'),
publicDir: path.resolve(__dirname, './src/renderer/public'),
resolve: {
alias: {
'@types': path.resolve(__dirname, './src/types'),
'@types/*': path.resolve(__dirname, './src/types/*'),
'@types/agent-cli': path.resolve(__dirname, './src/types/agent-cli.ts'),
'@': path.resolve(__dirname, './src/renderer'),
'@/*': path.resolve(__dirname, './src/renderer/*'),
'@assets': path.resolve(__dirname, './src/renderer/assets'),
'@assets/*': path.resolve(__dirname, './src/renderer/assets/*'),
},
},
assetsInclude: ['**/*.png', '**/*.jpg', '**/*.jpeg', '**/*.gif', '**/*.svg', '**/*.webp'],
build: {
outDir: path.resolve(__dirname, 'dist/renderer'),
emptyOutDir: true,
assetsDir: 'assets',
},
server: {
host: DEV_SERVER_HOST,
port: DEV_SERVER_PORT,
strictPort: true,
},
};
});