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.
Support Micro Front-End Framework
- qiankun
- single-SPA waiting for test and verify
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
npm run dev
License
Copyright (c) FEMessage