forked from gongxuegit/tiku-backend.net
feat: add Vite configuration for Tiku.PlatformAdmin.Web and update documentation
- Introduced Vite configuration files (vite.config.js, vite.config.ts, vite.config.d.ts) for the React frontend. - Configured server proxy settings for API endpoints. - Added Vitest configuration files (vitest.config.js, vitest.config.ts, vitest.config.d.ts) for testing. - Updated architecture overview to reflect the separation of the platform admin frontend into its own React project. - Modified quickstart documentation to guide users on starting the platform admin frontend.
This commit is contained in:
29
Tiku.PlatformAdmin.Web/vite.config.ts
Normal file
29
Tiku.PlatformAdmin.Web/vite.config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
const apiTarget = env.VITE_DEV_API_TARGET || 'http://localhost:5090';
|
||||
|
||||
return {
|
||||
plugins: [react()],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (id.includes('node_modules/react') || id.includes('node_modules/scheduler')) return 'react';
|
||||
if (id.includes('node_modules/antd') || id.includes('node_modules/@ant-design') || id.includes('node_modules/rc-')) return 'antd';
|
||||
if (id.includes('node_modules')) return 'vendor';
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
'/api': { target: apiTarget, changeOrigin: true },
|
||||
'/openapi': { target: apiTarget, changeOrigin: true },
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user