Core/vite.config.ts
Madeorsk ff6e8be4ae
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Migrate to preact and update react-router.
2024-11-29 17:43:56 +01:00

32 lines
665 B
TypeScript

import {ConfigEnv, defineConfig, UserConfig} from "vite";
import dts from "vite-plugin-dts";
import preact from "@preact/preset-vite";
// 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: ["preact", "@preact/compat", "react-router-dom", "@phosphor-icons/react"],
},
},
plugins: [
preact(),
dts({
rollupTypes: true,
insertTypesEntry: true,
exclude: ["demo", "node_modules"],
}),
]
});
});