-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
46 lines (41 loc) · 1.01 KB
/
vite.config.ts
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
/* eslint-env node */
/* eslint-disable camelcase */
import { fileURLToPath } from 'node:url';
import react from '@vitejs/plugin-react';
import { defineConfig, type UserConfig } from 'vite';
const IS_DEBUG = false;
export default defineConfig(({ mode }) => {
const config: UserConfig = {
plugins: [react()],
esbuild: { target: 'esnext' },
envPrefix: 'APP_',
envDir: '../',
root: 'src',
publicDir: '../public',
clearScreen: false,
server: {
host: 'localhost',
open: false,
cors: true,
port: 3000
},
build: {
target: 'esnext',
emptyOutDir: true,
outDir: '../dist',
rollupOptions: {
input: {
index: fileURLToPath(new URL('./src/index.html', import.meta.url)),
profile: fileURLToPath(new URL('./src/pages/profile/index.html', import.meta.url)),
team: fileURLToPath(new URL('./src/pages/team/index.html', import.meta.url))
}
}
},
optimizeDeps: { esbuildOptions: { target: 'esnext' } },
preview: {
open: true,
cors: true
}
};
return config;
});