mm
This commit is contained in:
44
packages/ui/vite.config.ts
Normal file
44
packages/ui/vite.config.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
// vite.config.ts
|
||||
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({
|
||||
rollupTypes: true,
|
||||
include: ["src"],
|
||||
}),
|
||||
],
|
||||
|
||||
optimizeDeps: {
|
||||
include: ["react", "react-dom"],
|
||||
},
|
||||
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, "src/index.ts"),
|
||||
name: "DefgovUI",
|
||||
formats: ["es", "umd"],
|
||||
fileName: (format) => {
|
||||
return `index.${format}.js`;
|
||||
},
|
||||
},
|
||||
|
||||
rollupOptions: {
|
||||
external: ["react", "react-dom", "react/jsx-runtime"],
|
||||
output: {
|
||||
globals: {
|
||||
react: "React",
|
||||
"react-dom": "ReactDOM",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
sourcemap: true,
|
||||
minify: "esbuild",
|
||||
cssCodeSplit: true,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user