-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
58 lines (57 loc) · 1.53 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
47
48
49
50
51
52
53
54
55
56
57
58
import { defineConfig } from 'vite';
import path from 'path';
export default defineConfig(({ command, mode }) => {
return {
plugins: [],
resolve: {
alias: {
'@': path.resolve('Src')
}
},
esbuild: {
drop: command === 'serve' ? [] : ['debugger'],
pure: command === 'serve' ? [] : ['console.log']
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler'
}
}
},
build: {
outDir: path.join(__dirname, 'Dist'),
emptyOutDir: true,
minify: 'esbuild',
assetsDir: 'Source',
sourcemap: false,
target: 'esnext',
rollupOptions: {
output: {
manualChunks: (id: string) => {
if (id.includes('node_modules')) {
return 'Vendor';
}
}
}
}
},
root: path.join(__dirname, ''),
publicDir: 'Public',
optimizeDeps: {
include: []
},
base: './',
envDir: './Env',
server: {
host: '0.0.0.0',
port: 6768,
open: true,
strictPort: true,
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp'
}
}
};
});