A CLI tool to create Next.js Micro Frontend applications using Module Federation.
npm install -g create-nextjs-mfeCreate a new Micro Frontend application:
create-nextjs-mfe create host-app --type host --port 3000 --remotes "remote1,remote2"--type: Type of application (host or remote)--port: Port number for the application--remotes: Comma-separated list of remote applications (for host apps only)
The CLI will create:
- A host application
- Remote applications as specified
- Module Federation configuration
- TypeScript and TailwindCSS setup
- Exposed components (Counter and Card)
- Create your applications:
create-nextjs-mfe create host-app --type host --port 3000 --remotes remote1,remote2- Install dependencies:
cd apps/remote1
npm install --legacy-peer-deps
cd ../remote2
npm install --legacy-peer-deps
cd ../host-app
npm install --legacy-peer-deps- Start the applications:
# Start remote apps first
cd apps/remote1
npm run dev
# In another terminal
cd apps/remote2
npm run dev
# Finally, start the host app
cd apps/host-app
npm run devMIT