-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.mts
More file actions
45 lines (43 loc) · 956 Bytes
/
vite.config.mts
File metadata and controls
45 lines (43 loc) · 956 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { defineConfig, loadEnv } from 'vite';
import path from 'path';
import reactSwc from '@vitejs/plugin-react-swc';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
build: {
sourcemap: false,
outDir: './build',
rollupOptions: {
output: {
entryFileNames: '[name].js',
assetFileNames: '[name].[ext]',
},
},
},
define: {
'process.env.NODE_ENV': JSON.stringify(env.mode),
},
plugins: [reactSwc()],
resolve: {
alias: [
{
find: '@',
replacement: path.resolve(__dirname, 'src'),
},
{
find: 'root',
replacement: path.resolve(__dirname),
},
],
},
server: {
proxy: {
'/api': {
target: env.VITE_API_BASE_URL,
changeOrigin: false,
secure: false,
},
},
},
};
});