-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
46 lines (41 loc) · 1.09 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
import { defineConfig } from 'vite'
import type { WatcherOptions } from 'rollup'
import solidPlugin from 'vite-plugin-solid'
import { resolve } from 'path'
import tsconfigPaths from 'vite-tsconfig-paths'
let target = 'https://dozar.bid'
if (process.env.local_api_target) {
target = 'http://127.0.0.1:7200'
}
console.log('api target: ' + target)
export default defineConfig(env => {
let watch: WatcherOptions | null = null
if (env.mode == 'development') {
watch = {
clearScreen: true,
}
}
return {
plugins: [tsconfigPaths(), solidPlugin({ hot: false })],
server: {
https: false,
port: 8200,
proxy: {
'/api/': {
target,
changeOrigin: true,
},
},
},
build: {
target: 'esnext',
outDir: 'dist',
watch,
assetsInlineLimit: 0,
copyPublicDir: false,
},
// resolve: {
// alias: { '!': resolve(__dirname, 'app') },
// },
}
})