-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
48 lines (39 loc) · 1.05 KB
/
vite.config.js
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
import { fileURLToPath, URL } from 'node:url';
import path from 'node:path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// Vite settings (https://vitejs.dev/config/)
const config = {
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'~bootstrap': path.resolve(__dirname, 'node_modules/bootstrap'),
'~hover': path.resolve(__dirname, 'node_modules/hover.css'),
'~front-matter': path.resolve(__dirname, 'node_modules/front-matter'),
'~marked': path.resolve(__dirname, 'node_modules/marked'),
'~dompurify': path.resolve(__dirname, 'node_modules/dompurify')
}
}
};
export default defineConfig(({ command, mode }) => {
if (command === 'serve') {
// Development mode (vite dev)
return {
...config,
base: '/',
server: {
port: 8080
}
};
} else {
// Production mode (vite build)
return {
...config,
base: '/hepgame',
build: {
outDir: 'dist'
}
};
}
});