forked from creatorcluster/renderdragon.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
67 lines (65 loc) · 1.73 KB
/
vite.config.ts
File metadata and controls
67 lines (65 loc) · 1.73 KB
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
import { defineConfig, loadEnv } from "vite";
import sitemap from 'vite-plugin-sitemap';
import react from "@vitejs/plugin-react-swc";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
// Load env file based on `mode` in the current working directory.
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
const env = loadEnv(mode, process.cwd(), '');
return {
server: {
host: "::",
port: 8080,
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
secure: false,
},
'/mci-proxy': {
target: 'https://hydrogenchloride.vercel.app',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/mci-proxy/, '/api/assets'),
secure: false,
},
},
},
plugins: [
sitemap({
hostname: 'https://renderdragon.org',
}),
react(),
].filter(Boolean),
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
optimizeDeps: {
include: [
'html2canvas',
'@radix-ui/react-primitive',
'@radix-ui/react-use-callback-ref',
'@radix-ui/react-use-controllable-state',
'@radix-ui/react-use-layout-effect',
'@radix-ui/react-use-previous',
'@radix-ui/react-visually-hidden',
'aria-hidden',
'react-remove-scroll',
'@radix-ui/react-context',
'@radix-ui/react-compose-refs'
]
},
build: {
commonjsOptions: {
include: [/node_modules/],
transformMixedEsModules: true
}
},
// Vite env configuration
define: {
'process.env': env
}
};
});