hel-micro-node
v1.0.1
Published
hel-micro sdk for node, a better implement of module federation
Maintainers
Readme
hel-micro-node
服务端js模块动态化加载方案
使用方式
先映射模块,再导入你的应用入口文件启动服务。
import { mapAndPreload } from 'hel-micro-node';
async function start(){
await mapAndPreload({'@hel-demo/mono-libs': true});
await import('./yourServerEntry');
}如不映射 @hel-demo/mono-libs,则你的服务使用的是原型的 node 模块
async function start(){
// await mapAndPreload({'@hel-demo/mono-libs': true});
await import('./yourServerEntry');
}