-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
28 lines (26 loc) · 876 Bytes
/
Copy pathvite.config.ts
File metadata and controls
28 lines (26 loc) · 876 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
// vite.config.ts
import path from 'node:path';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import react from '@vitejs/plugin-react';
import { defineConfig, loadEnv } from 'vite';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
base: env.VITE_BASE ?? '/',
// shioaji app upload flattens nested paths — emit a flat bundle
build: { assetsDir: '' },
// react-draggable (react-grid-layout dep) reads process.env at runtime
define: { 'process.env': {} },
plugins: [vanillaExtractPlugin(), react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
proxy: {
'/api': 'http://localhost:8080',
},
},
};
});