-
Notifications
You must be signed in to change notification settings - Fork 34
/
vite.config.ts
43 lines (41 loc) · 1.02 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
import { createServer } from './backend/index';
import { defineConfig } from 'vite';
import istanbul from 'vite-plugin-istanbul';
import svgLoader from 'vite-svg-loader';
import vue from '@vitejs/plugin-vue';
import pluginEnv from 'vite-plugin-vue-env';
import tsconfigPaths from 'vite-tsconfig-paths'
import constants from './constants'
const { APP, SERVER } = constants
export default defineConfig({
define: {
'process.env': {}
},
plugins: [
vue(),
svgLoader(),
pluginEnv(),
istanbul({
exclude: ['node_modules', 'test/'],
extension: ['.js', '.ts', '.vue'],
include: 'src/*',
cypress: true
}),
createServer(),
tsconfigPaths({ extensions: ['.ts', '.d.ts'] })
],
server: {
port: APP,
proxy: {
'^/api/.*': {
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
target: `http://localhost:${SERVER}`
},
'^/socket.io/.*': {
changeOrigin: true,
target: `http://localhost:${SERVER}`,
}
}
}
});