https://github.com/antonybudianto/vite-nuxt-mfe
Starter for Vite Nuxt 3 Micro-frontend, with vite-plugin-federation. (Nuxt 3 as host and remote)
https://github.com/antonybudianto/vite-nuxt-mfe
mfe micro-frontend microfrontend-architecture microfrontends-demo nuxt nuxt3 vite vite-plugin-federation
Last synced: 3 months ago
JSON representation
Starter for Vite Nuxt 3 Micro-frontend, with vite-plugin-federation. (Nuxt 3 as host and remote)
- Host: GitHub
- URL: https://github.com/antonybudianto/vite-nuxt-mfe
- Owner: antonybudianto
- Created: 2024-12-20T15:59:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-18T00:40:09.000Z (over 1 year ago)
- Last Synced: 2025-02-18T01:29:13.884Z (over 1 year ago)
- Topics: mfe, micro-frontend, microfrontend-architecture, microfrontends-demo, nuxt, nuxt3, vite, vite-plugin-federation
- Language: Vue
- Homepage:
- Size: 450 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vite-nuxt-mfe
Vite-based Nuxt 3 starter with Micro-frontend enabled.
## Demo
- Demo Web: https://demo-ab-nuxt-mfe-host.netlify.app/
- Repo Host: https://github.com/antonybudianto/demo-nuxt-mfe1
- Repo Remote: https://github.com/antonybudianto/demo-nuxt-mfe-rmt1
## Initial setup
```
cd host
cp .env.example .env
```
## Development
First, we need to build the remote first. Check [this](https://github.com/originjs/vite-plugin-federation/issues/525) for why.
```
cd remote
pnpm i
pnpm build
pnpm serve
```
```
cd host
pnpm i
pnpm dev
```
Open http://localhost:3000
## Deployment
```
cd remote
pnpm i
pnpm build
pnpm serve
cd host
pnpm i
pnpm build
pnpm serve
```
## Notes
- It's recommended to split the repository for Host and Remote, and deploy separately
- If you want to go with monorepo approach, make sure to setup a monorepo package manager (Pnpm workspace, Nx, etc.)
- This repo is still evolving, and might not be production-ready yet
- No SSR support (no plan for this)
## TODO
- Pinia integration
- Build-mode works but Dev-mode not works (fixed)
- Enable CORS on remote JS assets (fixed)
- Scoped style still not works (fixed)
## Links
- https://github.com/originjs/vite-plugin-federation/