远程组件Demo
Go to file
2024-12-23 18:43:20 +07:00
host chore: remote url from env 2024-12-23 15:55:38 +07:00
remote feat: add links 2024-12-23 18:25:50 +07:00
.gitignore init 2024-12-20 22:58:41 +07:00
.prettierrc chore: prettier 2024-12-21 07:53:23 +07:00
README.md Update README.md 2024-12-23 18:43:20 +07:00

vite-nuxt-mfe

Vite-based Nuxt 3 starter with Micro-frontend enabled.

Demo

Initial setup

cd host
cp .env.example .env

Development

First, we need to build the remote first. Check this 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)