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

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