forked from open-source-labs/dbSpy
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
36 lines (35 loc) · 870 Bytes
/
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
import { defineConfig } from 'vite';
import dns from 'dns';
import react from '@vitejs/plugin-react';
const fs = require('fs');
import { resolve } from 'path';
dns.setDefaultResultOrder('verbatim');
export default defineConfig({
server: {
port: 8080,
host: true,
proxy: {
'/api/': {
// TODO - vite proxy error
// Vite is unable to recognize localhost IPv6 equivalent, so have to change target to the loopback address for IPv4 (http://localhost:3000/ -> http://127.0.0.1:3000/)
target: 'http://127.0.0.1:3000/',
changeOrigin: true,
secure: false,
},
},
},
build: {
outDir: 'dist',
rollupOptions: {
input: resolve(__dirname, 'index.html'),
},
commonjsOptions: {
esmExternals: true,
},
},
plugins: [
react({
include: '**/*.{jsx,tsx}',
}),
],
});