DocsGPT/extensions/react-widget/vite.config.ts

27 lines
595 B
TypeScript
Raw Normal View History

2023-09-12 13:01:12 +00:00
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import dts from "vite-plugin-dts";
import path from "path";
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, "index.ts"),
name: "ViteButton",
fileName: (format) => `index.${format}.js`,
},
rollupOptions: {
external: ["react", "react-dom"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
},
sourcemap: true,
emptyOutDir: true,
},
plugins: [react(), dts()],
});