Core/vite.config.ts
Madeorsk db3e46ae7c
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
Fix dev and production builds with React.
2024-09-23 00:06:37 +02:00

31 lines
590 B
TypeScript

import {ConfigEnv, defineConfig, UserConfig} from "vite";
import dts from "vite-plugin-dts";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
return ({
build: {
outDir: "lib",
sourcemap: true,
minify: "esbuild",
lib: {
entry: "index.ts",
formats: ["es"],
fileName: "index",
},
rollupOptions: {
external: ["react", "react-dom"],
},
},
plugins: [
react(),
dts({
insertTypesEntry: true,
exclude: ["demo", "node_modules"],
}),
]
});
});