Using frontend microservices with Nuxt, support qiankun now
- Add
@femessage/nuxt-micro-frontend
dependency to your project
yarn add @femessage/nuxt-micro-frontend -D
# or npm install @femessage/nuxt-micro-frontend
- Add
@femessage/nuxt-micro-frontend
to themodules
section ofnuxt.config.js
{
modules: [
// Simple usage
'@femessage/nuxt-micro-frontend',
// With options
['@femessage/nuxt-micro-frontend', { /* module options */ }]
]
}
If want to set headers recommend to set
build.devMiddleware.headers
, see Nuxt API: The build Property > devMiddleware
path: the MFE lifecycle hook file path relative to rootDir
force: skip version check and force to use this module
unique: If use qiankun, sub application's package name should unique. Set unique to true can create a unique umd target.
output: If use the other micro library, probably need to config the webpack output libraryTarget.
- qiankun
- single-SPA example in examples/single-spa-demo
- add
mounted
andbeforeUnmount
hook to get vue instance
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
cd examples/normal && npm run dev
Copyright (c) FEMessage
Thanks goes to these wonderful people (emoji key):
cjf 💻 📖 📝 💡 | Han 💻 🖋 🚇 |
This project follows the all-contributors specification. Contributions of any kind welcome!