init: 初始化

This commit is contained in:
Montia37
2025-08-13 04:32:05 +08:00
commit af6f7b1d09
343 changed files with 9919 additions and 0 deletions

43
vite.config.ts Normal file
View File

@@ -0,0 +1,43 @@
import path from "path";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig, loadEnv } from "vite";
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
return {
plugins: [react(), tailwindcss()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
assetsDir: "assets",
outDir: "dist",
rollupOptions: {
output: {
// go embed ignore files start with '_'
chunkFileNames: "assets/chunk-[name]-[hash].js",
entryFileNames: "assets/entry-[name]-[hash].js",
manualChunks: {
"react-vendor": ["react", "react-dom"],
},
},
},
},
server: {
host: "127.0.0.1",
proxy: {
"/api": {
target: env.VITE_API_TARGET || "http://localhost:3000",
changeOrigin: true,
ws: true,
secure: false,
},
},
},
};
});