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'.
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
import {ModuleMapLoaderModule} from '@nguniversal/module-map-ngfactory-loader';
@NgModule({
imports: [
AppModule,
ServerModule,
ModuleMapLoaderModule
],
bootstrap: [AppComponent],
})
export class AppServerModule {}
16.0.0 (2023-05-03)
Breaking Changes
@nguniversal/common
-
Node.js v14 support has been removed
Node.js v14 is planned to be End-of-Life on 2023-04-30. Angular will stop supporting Node.js v14 in Angular v16. Angular v16 will continue to officially support Node.js versions v16 and v18.
@nguniversal/express-engine
| Commit | Type | Description |
| ------------------------------------------------------------------------------------------------ | ---- | ---------------------------------------------------------- |
| 3af1451a | feat | add standalone support to ng add
|
| 1e2b9385 | feat | support rendering standalone application |
| 500f5e54 | fix | export default bootstrap in server template for standalone |
| 66021f10 | fix | update import for template server file |
@nguniversal/builders
| Commit | Type | Description |
| ------------------------------------------------------------------------------------------------ | ---- | ----------------------------------------------------- |
| 0481bde7 | feat | add support for prerendering a standalone application |
@nguniversal/common
| Commit | Type | Description |
| ------------------------------------------------------------------------------------------------ | -------- | ------------------------------------------------------ |
| 9fbdb23c | feat | add CSP support for inline styles |
| 010546e5 | feat | support rendering standalone application |
| 71c2cef8 | fix | update TransferHttpResponse requiring body and headers |
| ae96fbc4 | refactor | remove Node.js v14 support |
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.2.1"></a>