forked from Kattoor/aeternum-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
37 lines (34 loc) · 911 Bytes
/
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
import dotenv from 'dotenv';
dotenv.config();
import { defineConfig } from 'vite';
import reactRefresh from '@vitejs/plugin-react-refresh';
import { resolve } from 'path';
const { PORT = 3001 } = process.env;
// https://vitejs.dev/config/
export default defineConfig({
plugins: [reactRefresh()],
server: {
proxy: {
'/api': {
target: `http://localhost:${PORT}`,
changeOrigin: true,
},
},
},
root: resolve(__dirname, 'src/app'),
publicDir: resolve(__dirname, 'src/app/public'),
build: {
target: 'esnext',
outDir: resolve(__dirname, 'dist/server/app'),
rollupOptions: {
input: {
minimap: resolve(__dirname, 'src/app/minimap.html'),
privacy: resolve(__dirname, 'src/app/privacy.html'),
index: resolve(__dirname, 'src/app/index.html'),
},
},
},
esbuild: {
jsxInject: `import React from 'react'`,
},
});