-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.mjs
38 lines (37 loc) · 994 Bytes
/
vite.config.mjs
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
import path from 'node:path';
import {spawn} from 'node:child_process';
import {platform} from 'node:os';
import {defineConfig} from 'vite';
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
export default defineConfig(async ({command}) => ({
root: path.resolve(__dirname, 'frontend'),
build: {
outDir: path.resolve(__dirname, 'dist'),
emptyOutDir: true
},
plugins: [
vue(),
{
name: 'server-trigger',
async buildStart() {
if (command === 'serve') {
spawn(
platform() === 'win32' ? 'npm.cmd' : 'npm',
['run', 'dev:backend'],
{stdio: 'inherit'}
);
}
},
}
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'frontend', 'src')
}
},
server: {
port: 8384,
strictPort: true
}
}));