-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
42 lines (39 loc) · 784 Bytes
/
Copy pathvite.config.js
File metadata and controls
42 lines (39 loc) · 784 Bytes
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
import {resolve} from 'node:path';
import {fileURLToPath} from 'node:url';
import {defineConfig} from 'vite';
const dirname = fileURLToPath(new URL('.', import.meta.url));
const root = resolve(dirname, 'src');
const outDir = resolve(dirname, 'dist');
export default defineConfig({
appType: 'mpa',
root,
esbuild: {
target: 'es2022',
},
build: {
outDir,
emptyOutDir: true,
target: 'es2022',
minify: true,
rollupOptions: {
input: {
main: resolve(root, 'index.html'),
},
},
},
server: {
proxy: {
'/api': {
target: 'http://localhost:3322',
},
},
},
vercel: {
rewrites: [
{
source: '/api/:path*',
destination: `${process.env.API_URL}:path*`,
},
],
},
});