import federation from "@originjs/vite-plugin-federation";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";

export default defineConfig({
	plugins: [
		react(),
		federation({
			name: "calcomblock",
			filename: "remoteEntry.js",
			exposes: {
				"./editor": "./editor.tsx",
				"./settings": "./settings.tsx",
			},
			shared: ["react", "react-dom", "@block-ninja/ui"],
		}),
	],
	build: {
		modulePreload: false,
		target: "esnext",
		minify: false,
		cssCodeSplit: false,
		outDir: "dist",
	},
});
