42 lines
835 B
TypeScript
42 lines
835 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import dts from "vite-plugin-dts";
|
|
import path from "path";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
tailwindcss(),
|
|
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"],
|
|
},
|
|
},
|
|
});
|