2023-02-14 15:57:58 +00:00
|
|
|
import react from "@vitejs/plugin-react-swc";
|
2022-11-03 14:06:26 +00:00
|
|
|
import path from "node:path";
|
|
|
|
import peerDepsExternal from "rollup-plugin-peer-deps-external";
|
|
|
|
import { defineConfig } from "vite";
|
2022-11-18 16:13:39 +00:00
|
|
|
import { checker } from "vite-plugin-checker";
|
2022-11-03 14:06:26 +00:00
|
|
|
import dts from "vite-plugin-dts";
|
2023-11-14 11:04:55 +00:00
|
|
|
import { libInjectCss } from "vite-plugin-lib-inject-css";
|
2022-11-03 14:06:26 +00:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
build: {
|
2023-10-09 15:59:32 +00:00
|
|
|
target: "esnext",
|
2022-11-03 14:06:26 +00:00
|
|
|
lib: {
|
|
|
|
entry: path.resolve(__dirname, "src/main.ts"),
|
|
|
|
formats: ["es"],
|
|
|
|
},
|
|
|
|
rollupOptions: {
|
|
|
|
plugins: [
|
|
|
|
peerDepsExternal({
|
|
|
|
includeDependencies: true,
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
react(),
|
2023-11-14 11:04:55 +00:00
|
|
|
libInjectCss(),
|
2022-11-03 14:06:26 +00:00
|
|
|
checker({ typescript: true }),
|
|
|
|
dts({ insertTypesEntry: true }),
|
|
|
|
],
|
|
|
|
});
|