2026-05-22 12:41:55 +00:00
|
|
|
import react from '@vitejs/plugin-react';
|
2026-06-02 02:42:07 +07:00
|
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
2026-05-22 12:41:55 +00:00
|
|
|
import path from 'node:path';
|
2026-05-22 21:53:01 +00:00
|
|
|
import { defineConfig, loadEnv } from 'vite';
|
2026-05-22 12:41:55 +00:00
|
|
|
|
2026-05-22 21:53:01 +00:00
|
|
|
export default defineConfig(({ mode }) => {
|
|
|
|
|
const env = loadEnv(mode, process.cwd(), '');
|
|
|
|
|
const apiProxyTarget = env.VITE_API_PROXY_TARGET || 'http://localhost:3000';
|
|
|
|
|
|
|
|
|
|
return {
|
2026-06-02 02:42:07 +07:00
|
|
|
plugins: [react(), tsconfigPaths()],
|
2026-05-22 21:53:01 +00:00
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
'/api': apiProxyTarget,
|
|
|
|
|
},
|
2026-05-22 18:50:07 +00:00
|
|
|
},
|
2026-05-22 21:53:01 +00:00
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': path.resolve(__dirname, './src'),
|
|
|
|
|
},
|
2026-05-22 12:41:55 +00:00
|
|
|
},
|
2026-05-22 21:53:01 +00:00
|
|
|
};
|
2026-05-22 12:41:55 +00:00
|
|
|
});
|