Add new Microfrontend Package
npx degit damianpumar/mf-package <YOUR_PACKAGE_NAME>Replace .env file with
VITE_<YOUR_PACKAGE_NAME>=http://localhost:300X
ex: VITE_PACKAGE=http://localhost:3001NOTE: <YOUR_PACKAGE_NAME> should be capital letters
Replace your package name in your package.json
Configure vite.config.ts for microfrontend package
export default defineConfig({
federation: {
name: "package",
exposes: {
"./package": "./src/App.tsx",
},
},
plugins: [react()],
});NOTE: if your package is the "HOST" should be something like that (without exposes):
export default defineConfig({
federation: {
name: "host",
},
plugins: [react()],
});Install dependencies
In your root project execute
pnpm install:allStart up your project
pnpm devOn this page
Contributors
Created June 22, 2025
Updated June 22, 2025