This commit is contained in:
2026-03-25 14:59:06 +08:00
commit ae315100b4
92 changed files with 9285 additions and 0 deletions

40
vite.config.ts Normal file
View File

@@ -0,0 +1,40 @@
import path from "path";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
// https://vite.dev/config/
export default defineConfig({
envDir: path.resolve(".", "env"),
plugins: [react()],
css: {
modules: {
localsConvention: "camelCase",
},
},
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes("node_modules")) {
if (id.includes("react")) {
return "react";
} else {
return "vendors";
}
}
return;
},
chunkFileNames: (chunkFileInfo) => {
for (const id of chunkFileInfo.moduleIds) {
const match = id.match(/\/pages\/([^/]+)/);
if (match) {
return `js/${match[1].toLocaleLowerCase()}-[hash].js`;
}
}
return "js/[name]-[hash].js";
},
},
},
},
});