@femessage/nuxt-micro-frontend
v1.7.0
Published
Using front-end microservices with Nuxt
Downloads
1,085
Readme
Nuxt-Micro-Frontend
Using frontend microservices with Nuxt, support qiankun now
Setup
- 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 */ }]
]
}
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.
Support Micro Front-End Framework
- [x] qiankun
- [x] single-SPA example in examples/single-spa-demo
LifeCycle hooks file example
- add
mounted
andbeforeUnmount
hook to get vue instance
Development
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
cd examples/normal && npm run dev
License
Copyright (c) FEMessage
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!