refactor: 迁移 Bun fullstack 架构
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
const backendPort = Number(process.env["BACKEND_PORT"] ?? process.env["PORT"] ?? 3000);
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
assetsDir: "assets",
|
||||
emptyOutDir: true,
|
||||
outDir: "../../dist/web",
|
||||
rolldownOptions: {
|
||||
output: {
|
||||
codeSplitting: {
|
||||
groups: [
|
||||
{ name: "vendor-react", test: /node_modules\/(react|react-dom|scheduler)/ },
|
||||
{ name: "vendor-tdesign", test: /node_modules\/tdesign/ },
|
||||
{ name: "vendor-chart", test: /node_modules\/(recharts|d3-)/ },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [react()],
|
||||
root: "src/web",
|
||||
server: {
|
||||
host: "127.0.0.1",
|
||||
port: 5173,
|
||||
proxy: {
|
||||
"/api": {
|
||||
changeOrigin: true,
|
||||
target: `http://127.0.0.1:${backendPort}`,
|
||||
},
|
||||
},
|
||||
strictPort: true,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user