# single-spa-mf

> combine single-spa with module federation

Latest version **0.0.14** (published 2022-06-15) · 0 weekly downloads

## Install

```sh
npm install single-spa-mf
pnpm add single-spa-mf
yarn add single-spa-mf
bun add single-spa-mf
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2022-06-15 |
| First published | 2021-12-23 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Maintainers | yiminghe |

## Links

- npm: https://www.npmjs.com/package/single-spa-mf
- Repository: https://github.com/yiminghe/single-spa-mf
- Homepage: https://github.com/yiminghe/single-spa-mf#readme
- Issues: https://github.com/yiminghe/single-spa-mf/issues
- npm.io page: https://npm.io/package/single-spa-mf

## Dependencies (2)

- [single-spa](https://npm.io/package/single-spa.md) 5.x
- [dom-element-getter-helpers](https://npm.io/package/dom-element-getter-helpers.md) 1.x

## Recent versions

- 0.0.14 (latest) — 2022-06-15
- 0.0.13 — 2022-05-27
- 0.0.12 — 2021-12-29
- 0.0.11 — 2021-12-25
- 0.0.10 — 2021-12-24
- 0.0.9 — 2021-12-24
- 0.0.8 — 2021-12-24
- 0.0.7 — 2021-12-24
- 0.0.6 — 2021-12-24
- 0.0.5 — 2021-12-24
- 0.0.4 — 2021-12-24
- 0.0.3 — 2021-12-23
- 0.0.2 — 2021-12-23
- 0.0.1 — 2021-12-23

## README

## single-spa-mf

A micro frontend solution based on single-spa and module federation

[![NPM version](https://badge.fury.io/js/single-spa-mf.png)](http://badge.fury.io/js/single-spa-mf)
[![NPM downloads](http://img.shields.io/npm/dm/single-spa-mf.svg)](https://npmjs.org/package/single-spa-mf)


```
yarn add single-spa-mf
```

### API

#### single-spa-mf

```ts
import { registerApplication, LifeCycles } from 'single-spa';
import * as webpack from './webpack';
export { webpack };
export interface MFAppHandle {
    mount: (el: HTMLElement) => Promise<void> | void;
    unmount: (el: HTMLElement) => Promise<void> | void;
}
declare type SingleSpaConfig = Parameters<typeof registerApplication>[0];
export interface MFApp {
    name: string;
    activeWhen: SingleSpaConfig['activeWhen'];
    /** main app module */
    app?: (e: {
        name: string;
    }) => Promise<LifeCycles<any>>;
    /** app entry url */
    entry?: (e: {
        name: string;
        entryName: string;
    }) => string | Promise<string>;
    customProps?: SingleSpaConfig['customProps'];
    loader?: MFAppHandle;
    error?: MFAppHandle;
}
export declare function registerMFApplications(appArray: MFApp[]): void;
export * from 'single-spa';

```

#### single-spa-mf/webpack

```ts
export declare const getMFAppConfig: ({ app }: {
    app: string;
}) => {
    name: string;
    filename: string;
};
export declare const getMFExposes: (mod: string) => {
    [x: string]: string;
};
```

### demo

https://github.com/yiminghe/single-spa-mf

---
_Source: https://npm.io/package/single-spa-mf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
