@matt-umi/plugin-remote
TypeScript icon, indicating that this package has built-in type declarations

1.1.10 • Public • Published

umi 配置 webpack5 moduleFederation 插件

.umirc

{
	plugins:['@matt-umi/plugin-remote'],
	remote:{
		name:'moduleName',  // module 应用名称
		filename:'remoteEntry.js',  //  默认暴露的文件名
		exposes:{ // 暴露的模块
			expose:'./src/expose'  // 模块名称
		},
		remotes:{  // 远程应用
			remote: 'http://localhost:8000'  // 默认会处理成 module@url/filename
		},
		shared:['react'] // 共享依赖 默认react react-router
	}
}

内置 hook

import { useDynamicScript, useFederationComponent, loadComponent, RemoteComponent } from 'umi';

Package Sidebar

Install

npm i @matt-umi/plugin-remote

Weekly Downloads

2

Version

1.1.10

License

ISC

Unpacked Size

17.2 kB

Total Files

9

Last publish

Collaborators

  • matt_l