@eh5/nuxt-micro-frontend-ilc
v1.2.5
Published
Using front-end microservices with Nuxt
Downloads
6
Readme
Nuxt-Micro-Frontend
Setup
- Add
@eh5/nuxt-micro-frontend-ilc
dependency to your project
yarn add @eh5/nuxt-micro-frontend-ilc -D
# or npm install @eh5/nuxt-micro-frontend-ilc
- Add
@eh5/nuxt-micro-frontend-ilc
to themodules
section ofnuxt.config.js
{
modules: [
// Simple usage
'@eh5/nuxt-micro-frontend-ilc',
// With options
['@eh5/nuxt-micro-frontend-ilc', { /* module options */ }]
]
}
- enable
extractCSS
if you have css files defined in config
{
// ...
css: [
'element-ui/lib/theme-chalk/index.css'
// ...
],
build: {
extractCSS: true
}
// ...
}
Module Options
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.
publicPath: publicPath (default '/__nuxt/')
hotPublicPath: HMR publicPath (default '')
Support Micro Front-End Framework
- [x] ilc
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