# @nguniversal/module-map-ngfactory-loader

> NgFactoryLoader which uses a Map to load ngfactories without lazy loading

Latest version **8.2.6** (published 2019-12-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @nguniversal/module-map-ngfactory-loader
pnpm add @nguniversal/module-map-ngfactory-loader
yarn add @nguniversal/module-map-ngfactory-loader
bun add @nguniversal/module-map-ngfactory-loader
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 8.2.6 |
| Published | 2019-12-10 |
| First published | 2017-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 74.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3991 |
| Maintainers | nguniversal |
| Keywords | ngfactory, lazy loading, ssr, universal |

## Links

- npm: https://www.npmjs.com/package/@nguniversal/module-map-ngfactory-loader
- Repository: https://github.com/angular/universal
- Issues: https://github.com/angular/universal/issues
- npm.io page: https://npm.io/package/@nguniversal/module-map-ngfactory-loader

## Recent versions

- 8.2.6 (latest) — 2019-12-10
- 9.0.0-next.9 (next) — 2019-12-09
- 8.2.5 — 2019-12-10
- 9.0.0-next.8 — 2019-12-04
- 9.0.0-next.7 — 2019-12-03
- 9.0.0-next.6 — 2019-10-23
- 9.0.0-next.5 — 2019-10-15
- 9.0.0-next.3 — 2019-10-04
- 9.0.0-next.2 — 2019-09-24
- 9.0.0-next.1 — 2019-09-19
- 9.0.0-next.0 — 2019-09-16
- 9.0.0-next.0.with-local-changes — 2019-09-16
- 8.1.1 — 2019-07-04
- 8.1.0 — 2019-07-03
- 8.0.0-rc.1 — 2019-05-23
- … 26 more at https://npm.io/package/@nguniversal/module-map-ngfactory-loader/versions

## README

# Module Map NgFactory Loader

This is a NgFactory Loader which uses a map of modules instead of resolving modules lazily.

This is useful when executing in node because lazy loading serves no purpose

## Usage with `@angular/cli`

`npm install @nguniversal/module-map-ngfactory-loader --save`

`@angular/cli` will generate `LAZY_MODULE_MAP` in its main output bundle if you put app.platform = 'server'.

```ts
const { provideModuleMap } = require('@nguniversal/module-map-ngfactory-loader');
const { AppModuleNgFactory, LAZY_MODULE_MAP } = require('main.bundle.js');

renderModuleFactory(AppModuleNgFactory, {
  document: '<app-root></app-root>',
  url: '/',
  extraProviders: [
    provideModuleMap(LAZY_MODULE_MAP)
  ]
})
```

Add `ModuleMapLoaderModule` to your server module

```ts
import {ModuleMapLoaderModule} from '@nguniversal/module-map-ngfactory-loader';

@NgModule({
  imports: [
    AppModule,
    ServerModule,
    ModuleMapLoaderModule
  ],
  bootstrap: [AppComponent],
})
export class AppServerModule {}
```

---
_Source: https://npm.io/package/@nguniversal/module-map-ngfactory-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
