30 lines
516 B
TypeScript
30 lines
516 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,
|
||
|
lib: {
|
||
|
entry: "index.ts",
|
||
|
formats: ["es"],
|
||
|
fileName: "index",
|
||
|
},
|
||
|
rollupOptions: {
|
||
|
external: ["react"],
|
||
|
},
|
||
|
},
|
||
|
|
||
|
plugins: [
|
||
|
react(),
|
||
|
dts({
|
||
|
insertTypesEntry: true,
|
||
|
}),
|
||
|
]
|
||
|
});
|
||
|
});
|