41 lines
983 B
TypeScript
41 lines
983 B
TypeScript
import react from "@vitejs/plugin-react";
|
|
import { defineConfig } from "vite";
|
|
|
|
export default defineConfig({
|
|
build: {
|
|
emptyOutDir: true,
|
|
outDir: "../../dist/web",
|
|
rolldownOptions: {
|
|
output: {
|
|
codeSplitting: {
|
|
groups: [
|
|
{
|
|
name: "vendor-react",
|
|
test: /[\\/]node_modules[\\/](react|react-dom|scheduler)[\\/]/,
|
|
},
|
|
{
|
|
name: "vendor-router",
|
|
test: /[\\/]node_modules[\\/](react-router)[\\/]/,
|
|
},
|
|
{
|
|
name: "vendor-tdesign",
|
|
test: /[\\/]node_modules[\\/](tdesign-react|tdesign-icons-react)[\\/]/,
|
|
},
|
|
{
|
|
name: "vendor-chart",
|
|
test: /[\\/]node_modules[\\/](recharts|d3-.*)[\\/]/,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
plugins: [react()],
|
|
root: "src/web",
|
|
server: {
|
|
proxy: {
|
|
"/api": "http://127.0.0.1:3000",
|
|
},
|
|
},
|
|
});
|