@ng-mfe/sandbox
v0.1.1
Published
JavaScript and CSS sandbox isolation
Readme
@ng-mfe/sandbox
用于微前端子应用的 JavaScript 和 CSS 沙箱隔离。
安装
npm install @ng-mfe/sandbox用法
import { createSandbox } from '@ng-mfe/sandbox';
const sandbox = createSandbox({ name: 'sub-app' });
sandbox.activate();
// sub-app code runs in isolated context
sandbox.deactivate();API 接口
- createSandbox — 沙箱实例工厂
- ProxySandbox — 基于 Proxy 的 JS 隔离(默认)
- SnapshotSandbox — 快照/恢复式 JS 隔离(降级方案)
- createCssIsolation — 作用域 CSS 隔离
- 补丁:Timer、EventListener、DOM 副作用追踪
文档
查看主 README 获取完整文档。
