generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 14
/
vite.config.js
78 lines (75 loc) · 2.09 KB
/
vite.config.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { defineConfig } from 'vite'
import dotenv from 'dotenv'
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import dns from 'dns'
dotenv.config()
dns.setDefaultResultOrder('verbatim')
export default () => {
return defineConfig({
plugins: [react(), svgr(), nodePolyfills()],
server: {
watch: {
usePolling: true,
},
host: true,
port: '3000',
proxy: {
// Enter the endpoint that needs to be proxied, this is Vite's way of proxing
'/quarterly-data/graphs': {
// Quarterly graphs endpoint
target: process.env.DEV_URL,
changeOrigin: true,
},
'/v2/public/institutions': {
// Verifies user domain and associated institutions endpoint
target: process.env.DEV_URL,
changeOrigin: true,
},
'/hmda-auth/users': {
// Update LEIs associated with users account (Profile Page)
target: process.env.DEV_URL,
changeOrigin: true,
},
'/v2/reporting': {
// Modified LAR endpoint
target: process.env.DEV_URL,
changeOrigin: true,
},
'/v2/filing': {
// Fetch all filings
target: process.env.DEV_URL,
changeOrigin: true,
},
'/v2/admin/institutions': {
// HMDA Help endpoint
target: process.env.DEV_URL,
changeOrigin: true,
},
'/v2/admin/receipt/': {
// HMDA Help Submissions file download endpoint
target: process.env.DEV_URL,
changeOrigin: true,
},
'/v2/data-browser-api': {
// Data Browser API
target: process.env.DEV_URL,
changeOrigin: true,
},
'/v2/public/hmda/parse': {
// File Format Verification Tool API
target: process.env.DEV_URL,
changeOrigin: true,
},
},
},
optimizeDeps: {
esbuildOptions: {
loader: {
'.js': 'jsx',
},
},
},
})
}