This commit is contained in:
2026-05-06 02:59:19 +08:00
parent 015c4fb91e
commit da0a6d0f81
60 changed files with 2406 additions and 323 deletions

View File

@@ -0,0 +1,39 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import dts from "vite-plugin-dts";
import path from "path";
export default defineConfig({
plugins: [
react(),
dts({
insertTypesEntry: true,
}),
],
build: {
lib: {
entry: path.resolve(__dirname, "src/index.ts"),
name: "DefgovUIWeb",
formats: ["es", "cjs"],
fileName: (format) => `index.${format}.js`,
},
rollupOptions: {
external: ["react", "react-dom", "react/jsx-runtime"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
sourcemap: true,
cssCodeSplit: true,
watch: {
exclude: ["node_modules", "dist", ".git"],
},
},
});