File size: 610 Bytes
4c3f9c7
 
ef2c178
4c3f9c7
 
 
55151cc
4c3f9c7
 
b272e20
4c3f9c7
 
 
 
 
b272e20
 
 
55151cc
 
 
4c3f9c7
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import svgLoader from 'vite-svg-loader';
import { startApiServer } from './server/utils';

// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
  if (command === 'serve') startApiServer();
  return {
    plugins: [vue(), svgLoader()],
    server: {
      proxy: {
        '/api': 'http://127.0.0.1:3000',
      },
    },
    build: {
      outDir: 'dist/static',
    },
    define: {
      __TRUST_ORIGIN__: JSON.stringify(process.env.TRUST_ORIGIN || (mode === 'development' ? '*' : '')),
    },
  };
});