@nx/angular 23.0.0 → 23.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/src/builders/dev-server/schema.json +2 -2
- package/dist/src/builders/webpack-browser/webpack-browser.impl.js +1 -1
- package/dist/src/executors/application/application.impl.js +3 -14
- package/dist/src/executors/application/schema.json +9 -3
- package/dist/src/executors/application/utils/normalize-options.js +19 -8
- package/dist/src/executors/application/utils/validate-options.js +0 -10
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.d.ts +1 -1
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.js +4 -21
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.d.ts +1 -1
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.js +6 -9
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +7 -10
- package/dist/src/executors/unit-test/schema.json +8 -0
- package/dist/src/executors/unit-test/unit-test.impl.d.ts +1 -2
- package/dist/src/executors/unit-test/unit-test.impl.js +8 -0
- package/dist/src/executors/utilities/esbuild-extensions.js +17 -3
- package/dist/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +2 -5
- package/dist/src/executors/utilities/ng-packagr/stylesheet-processor.js +11 -19
- package/dist/src/executors/utilities/typescript.js +2 -4
- package/dist/src/generators/application/application.js +11 -15
- package/dist/src/generators/application/files/base/tsconfig.app.json__tpl__ +0 -5
- package/dist/src/generators/application/files/base/tsconfig.json__tpl__ +1 -4
- package/dist/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +1 -7
- package/dist/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.ts__tpl__ +1 -1
- package/dist/src/generators/application/files/ng-module/src/app/app__moduleTypeSeparator__module.ts__tpl__ +2 -2
- package/dist/src/generators/application/files/ng-module/src/main.ts__tpl__ +0 -8
- package/dist/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
- package/dist/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +1 -7
- package/dist/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.ts__tpl__ +1 -1
- package/dist/src/generators/application/lib/create-files.js +0 -8
- package/dist/src/generators/application/lib/create-project.js +3 -12
- package/dist/src/generators/application/lib/update-tsconfig-files.js +6 -36
- package/dist/src/generators/application/schema.d.ts +0 -1
- package/dist/src/generators/application/schema.json +0 -4
- package/dist/src/generators/component/component.js +1 -0
- package/dist/src/generators/component/files/__fileName__.ts__tpl__ +3 -2
- package/dist/src/generators/component/lib/index.d.ts +1 -0
- package/dist/src/generators/component/lib/index.js +1 -0
- package/dist/src/generators/component/lib/normalize-options.js +2 -4
- package/dist/src/generators/component/lib/validate-options.d.ts +3 -0
- package/dist/src/generators/component/lib/validate-options.js +10 -0
- package/dist/src/generators/component/schema.d.ts +1 -1
- package/dist/src/generators/component/schema.json +3 -4
- package/dist/src/generators/convert-to-application-executor/convert-to-application-executor.js +1 -6
- package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +1 -2
- package/dist/src/generators/directive/lib/normalize-options.js +0 -5
- package/dist/src/generators/directive/schema.json +1 -1
- package/dist/src/generators/library/lib/normalized-schema.d.ts +1 -1
- package/dist/src/generators/library/lib/update-tsconfig-files.js +6 -14
- package/dist/src/generators/library/schema.d.ts +1 -1
- package/dist/src/generators/library/schema.json +2 -3
- package/dist/src/generators/pipe/lib/normalize-options.js +1 -3
- package/dist/src/generators/pipe/schema.json +1 -1
- package/dist/src/generators/remote/lib/update-ssr-setup.js +1 -4
- package/dist/src/generators/scam/lib/normalize-options.js +0 -5
- package/dist/src/generators/scam/schema.d.ts +1 -1
- package/dist/src/generators/scam/schema.json +3 -4
- package/dist/src/generators/scam-directive/lib/normalize-options.js +0 -5
- package/dist/src/generators/scam-directive/schema.json +1 -1
- package/dist/src/generators/scam-pipe/lib/normalize-options.js +1 -3
- package/dist/src/generators/scam-pipe/schema.json +1 -1
- package/dist/src/generators/setup-mf/setup-mf.js +4 -7
- package/dist/src/generators/setup-ssr/lib/add-dependencies.js +1 -4
- package/dist/src/generators/setup-ssr/lib/add-server-file.js +3 -13
- package/dist/src/generators/setup-ssr/lib/generate-files.js +5 -27
- package/dist/src/generators/setup-ssr/lib/generate-server-ts-config.js +11 -20
- package/dist/src/generators/setup-ssr/lib/normalize-options.js +0 -17
- package/dist/src/generators/setup-ssr/lib/update-project-config.js +1 -6
- package/dist/src/generators/setup-ssr/lib/validate-options.js +0 -14
- package/dist/src/generators/setup-ssr/schema.d.ts +0 -1
- package/dist/src/generators/setup-ssr/schema.json +0 -4
- package/dist/src/generators/utils/app-components-info.js +1 -5
- package/dist/src/generators/utils/artifact-types.js +2 -10
- package/dist/src/generators/utils/ensure-angular-dependencies.js +0 -5
- package/dist/src/generators/utils/update-project-root-tsconfig.js +4 -4
- package/dist/src/generators/utils/version-utils.d.ts +0 -5
- package/dist/src/generators/utils/version-utils.js +0 -13
- package/dist/src/migrations/update-23-1-0/add-istanbul-instrumenter.d.ts +2 -0
- package/dist/src/migrations/update-23-1-0/add-istanbul-instrumenter.js +56 -0
- package/dist/src/migrations/update-23-1-0/add-istanbul-instrumenter.md +65 -0
- package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.d.ts +2 -0
- package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.js +61 -0
- package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.md +48 -0
- package/dist/src/migrations/update-23-1-0/rename-ssr-experimental-platform.d.ts +2 -0
- package/dist/src/migrations/update-23-1-0/rename-ssr-experimental-platform.js +70 -0
- package/dist/src/migrations/update-23-1-0/rename-ssr-experimental-platform.md +85 -0
- package/dist/src/utils/backward-compatible-versions.d.ts +2 -2
- package/dist/src/utils/backward-compatible-versions.js +23 -24
- package/dist/src/utils/versions.d.ts +7 -7
- package/dist/src/utils/versions.js +7 -7
- package/dist/src/utils/zoneless.d.ts +1 -1
- package/dist/types/nx-angular-mf.d.ts.map +1 -1
- package/dist/types/nx-angular.d.ts.map +1 -1
- package/migrations.json +188 -0
- package/package.json +18 -17
- package/dist/src/executors/extract-i18n/utils/validate-options.d.ts +0 -2
- package/dist/src/executors/extract-i18n/utils/validate-options.js +0 -13
- package/dist/src/executors/utilities/ng-packagr/package-imports.d.ts +0 -3
- package/dist/src/executors/utilities/ng-packagr/package-imports.js +0 -10
- package/dist/src/generators/application/files/base/tsconfig.editor.json__tpl__ +0 -5
- package/dist/src/generators/setup-ssr/files/v19/application-builder/ngmodule-src/__main__ +0 -1
- package/dist/src/generators/setup-ssr/files/v19/application-builder/ngmodule-src/app/__rootModuleFileName__ +0 -13
- package/dist/src/generators/setup-ssr/files/v19/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +0 -8
- package/dist/src/generators/setup-ssr/files/v19/application-builder/server/__serverFileName__ +0 -66
- package/dist/src/generators/setup-ssr/files/v19/application-builder/standalone-src/__main__ +0 -12
- package/dist/src/generators/setup-ssr/files/v19/application-builder/standalone-src/app/app.config.server.ts__tpl__ +0 -14
- package/dist/src/generators/setup-ssr/files/v19/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +0 -8
- package/dist/src/generators/setup-ssr/files/v19/application-builder-common-engine/server/__serverFileName__ +0 -67
- package/dist/src/generators/setup-ssr/files/v19/server-builder/ngmodule-src/__main__ +0 -1
- package/dist/src/generators/setup-ssr/files/v19/server-builder/ngmodule-src/app/__rootModuleFileName__ +0 -14
- package/dist/src/generators/setup-ssr/files/v19/server-builder/root/tsconfig.server.json.template +0 -16
- package/dist/src/generators/setup-ssr/files/v19/server-builder/server/__serverFileName__ +0 -69
- package/dist/src/generators/setup-ssr/files/v19/server-builder/standalone-src/__main__ +0 -12
- package/dist/src/generators/setup-ssr/files/v19/server-builder/standalone-src/app/app.config.server.ts.template +0 -11
package/dist/src/generators/setup-ssr/files/v19/application-builder/server/__serverFileName__
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AngularNodeAppEngine,
|
|
3
|
-
createNodeRequestHandler,
|
|
4
|
-
isMainModule,
|
|
5
|
-
writeResponseToNodeResponse,
|
|
6
|
-
} from '@angular/ssr/node';
|
|
7
|
-
import express from 'express';
|
|
8
|
-
import { dirname, resolve } from 'node:path';
|
|
9
|
-
import { fileURLToPath } from 'node:url';
|
|
10
|
-
|
|
11
|
-
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
|
|
12
|
-
const browserDistFolder = resolve(serverDistFolder, '../<%= browserDistDirectory %>');
|
|
13
|
-
|
|
14
|
-
const app = express();
|
|
15
|
-
const angularApp = new AngularNodeAppEngine();
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Example Express Rest API endpoints can be defined here.
|
|
19
|
-
* Uncomment and define endpoints as necessary.
|
|
20
|
-
*
|
|
21
|
-
* Example:
|
|
22
|
-
* ```ts
|
|
23
|
-
* app.get('/api/**', (req, res) => {
|
|
24
|
-
* // Handle API request
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Serve static files from /<%= browserDistDirectory %>
|
|
31
|
-
*/
|
|
32
|
-
app.use(
|
|
33
|
-
express.static(browserDistFolder, {
|
|
34
|
-
maxAge: '1y',
|
|
35
|
-
index: false,
|
|
36
|
-
redirect: false,
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Handle all other requests by rendering the Angular application.
|
|
42
|
-
*/
|
|
43
|
-
app.use('/**', (req, res, next) => {
|
|
44
|
-
angularApp
|
|
45
|
-
.handle(req)
|
|
46
|
-
.then((response) =>
|
|
47
|
-
response ? writeResponseToNodeResponse(response, res) : next()
|
|
48
|
-
)
|
|
49
|
-
.catch(next);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Start the server if this module is the main entry point.
|
|
54
|
-
* The server listens on the port defined by the `PORT` environment variable, or defaults to <%= serverPort %>.
|
|
55
|
-
*/
|
|
56
|
-
if (isMainModule(import.meta.url)) {
|
|
57
|
-
const port = process.env['PORT'] || <%= serverPort %>;
|
|
58
|
-
app.listen(port, () => {
|
|
59
|
-
console.log(`Node Express server listening on http://localhost:${port}`);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Request handler used by the Angular CLI (for dev-server and during build) or Firebase Cloud Functions.
|
|
65
|
-
*/
|
|
66
|
-
export const reqHandler = createNodeRequestHandler(app);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
|
2
|
-
import { AppComponent } from './app/app.component';
|
|
3
|
-
import { config } from './app/app.config.server';
|
|
4
|
-
|
|
5
|
-
<%_ if (useBootstrapContext) { _%>
|
|
6
|
-
const bootstrap = (context: BootstrapContext) =>
|
|
7
|
-
bootstrapApplication(AppComponent, config, context);
|
|
8
|
-
<%_ } else { _%>
|
|
9
|
-
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
|
10
|
-
<%_ } _%>
|
|
11
|
-
|
|
12
|
-
export default bootstrap;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
|
|
2
|
-
import { provideServerRendering } from '@angular/platform-server';<% if(serverRouting) { %>
|
|
3
|
-
import { <%= provideServerRoutingFn %> } from '@angular/ssr';<% } %>
|
|
4
|
-
import { appConfig } from './app.config';<% if(serverRouting) { %>
|
|
5
|
-
import { serverRoutes } from './app.routes.server';<% } %>
|
|
6
|
-
|
|
7
|
-
const serverConfig: ApplicationConfig = {
|
|
8
|
-
providers: [
|
|
9
|
-
provideServerRendering()<% if(serverRouting) { %>,
|
|
10
|
-
<%= provideServerRoutingFn %>(serverRoutes)<% } %>
|
|
11
|
-
]
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const config = mergeApplicationConfig(appConfig, serverConfig);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { APP_BASE_HREF } from '@angular/common';
|
|
2
|
-
import { CommonEngine, isMainModule } from '@angular/ssr/node';
|
|
3
|
-
import express from 'express';
|
|
4
|
-
import { dirname, join, resolve } from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %> from './<%= main.slice(0, -3) %>';
|
|
7
|
-
|
|
8
|
-
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const browserDistFolder = resolve(serverDistFolder, '../<%= browserDistDirectory %>');
|
|
10
|
-
const indexHtml = join(serverDistFolder, 'index.server.html');
|
|
11
|
-
|
|
12
|
-
const app = express();
|
|
13
|
-
const commonEngine = new CommonEngine();
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Example Express Rest API endpoints can be defined here.
|
|
17
|
-
* Uncomment and define endpoints as necessary.
|
|
18
|
-
*
|
|
19
|
-
* Example:
|
|
20
|
-
* ```ts
|
|
21
|
-
* app.get('/api/**', (req, res) => {
|
|
22
|
-
* // Handle API request
|
|
23
|
-
* });
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Serve static files from /<%= browserDistDirectory %>
|
|
29
|
-
*/
|
|
30
|
-
app.get(
|
|
31
|
-
'**',
|
|
32
|
-
express.static(browserDistFolder, {
|
|
33
|
-
maxAge: '1y',
|
|
34
|
-
index: 'index.html'
|
|
35
|
-
}),
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Handle all other requests by rendering the Angular application.
|
|
40
|
-
*/
|
|
41
|
-
app.get('**', (req, res, next) => {
|
|
42
|
-
const { protocol, originalUrl, baseUrl, headers } = req;
|
|
43
|
-
|
|
44
|
-
commonEngine
|
|
45
|
-
.render({
|
|
46
|
-
bootstrap<% if (!standalone) { %>: <%= rootModuleClassName %><% } %>,
|
|
47
|
-
documentFilePath: indexHtml,
|
|
48
|
-
url: `${protocol}://${headers.host}${originalUrl}`,
|
|
49
|
-
publicPath: browserDistFolder,
|
|
50
|
-
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
|
|
51
|
-
})
|
|
52
|
-
.then((html) => res.send(html))
|
|
53
|
-
.catch((err) => next(err));
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Start the server if this module is the main entry point.
|
|
58
|
-
* The server listens on the port defined by the `PORT` environment variable, or defaults to 4000.
|
|
59
|
-
*/
|
|
60
|
-
if (isMainModule(import.meta.url)) {
|
|
61
|
-
const port = process.env['PORT'] || <%= serverPort %>;
|
|
62
|
-
app.listen(port, () => {
|
|
63
|
-
console.log(`Node Express server listening on http://localhost:${port}`);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export default app;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { <%= rootModuleClassName %> as default } from './app/<%= rootModuleFileName.slice(0, -3) %>';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { ServerModule } from '@angular/platform-server';
|
|
3
|
-
|
|
4
|
-
import { AppModule } from './app.module';
|
|
5
|
-
import { AppComponent } from './app.component';
|
|
6
|
-
|
|
7
|
-
@NgModule({
|
|
8
|
-
imports: [
|
|
9
|
-
AppModule,
|
|
10
|
-
ServerModule,
|
|
11
|
-
],
|
|
12
|
-
bootstrap: [AppComponent],
|
|
13
|
-
})
|
|
14
|
-
export class <%= rootModuleClassName %> {}
|
package/dist/src/generators/setup-ssr/files/v19/server-builder/root/tsconfig.server.json.template
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "./tsconfig.app.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"outDir": "<%= rootOffset %>out-tsc/server",
|
|
7
|
-
"types": [
|
|
8
|
-
"node"<% if (hasLocalizePackage) { %>,
|
|
9
|
-
"@angular/localize"<% } %>
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"files": [
|
|
13
|
-
"src/<%= main %>",
|
|
14
|
-
"src/server.ts"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import 'zone.js/node';
|
|
2
|
-
|
|
3
|
-
import { APP_BASE_HREF } from '@angular/common';
|
|
4
|
-
import { CommonEngine } from '@angular/ssr/node';
|
|
5
|
-
import * as express from 'express';
|
|
6
|
-
import { existsSync } from 'node:fs';
|
|
7
|
-
import { join } from 'node:path';
|
|
8
|
-
import <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %> from './<%= main.slice(0, -3) %>';
|
|
9
|
-
|
|
10
|
-
// The Express app is exported so that it can be used by serverless Functions.
|
|
11
|
-
export function app(): express.Express {
|
|
12
|
-
const server = express();
|
|
13
|
-
const distFolder = join(process.cwd(), '<%= browserDistDirectory %>');
|
|
14
|
-
const indexHtml = existsSync(join(distFolder, 'index.original.html'))
|
|
15
|
-
? join(distFolder, 'index.original.html')
|
|
16
|
-
: join(distFolder, 'index.html');
|
|
17
|
-
|
|
18
|
-
const commonEngine = new CommonEngine();
|
|
19
|
-
|
|
20
|
-
server.set('view engine', 'html');
|
|
21
|
-
server.set('views', distFolder);
|
|
22
|
-
|
|
23
|
-
// Example Express Rest API endpoints
|
|
24
|
-
// server.get('/api/**', (req, res) => { });
|
|
25
|
-
// Serve static files from /browser
|
|
26
|
-
server.get('*.*', express.static(distFolder, {
|
|
27
|
-
maxAge: '1y'
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
// All regular routes use the Angular engine
|
|
31
|
-
server.get('*', (req, res, next) => {
|
|
32
|
-
const { protocol, originalUrl, baseUrl, headers } = req;
|
|
33
|
-
|
|
34
|
-
commonEngine
|
|
35
|
-
.render({
|
|
36
|
-
bootstrap<% if (!standalone) { %>: <%= rootModuleClassName %><% } %>,
|
|
37
|
-
documentFilePath: indexHtml,
|
|
38
|
-
url: `${protocol}://${headers.host}${originalUrl}`,
|
|
39
|
-
publicPath: distFolder,
|
|
40
|
-
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
|
|
41
|
-
})
|
|
42
|
-
.then((html) => res.send(html))
|
|
43
|
-
.catch((err) => next(err));
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
return server;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function run(): void {
|
|
50
|
-
const port = process.env['PORT'] || <%= serverPort %>;
|
|
51
|
-
|
|
52
|
-
// Start up the Node server
|
|
53
|
-
const server = app();
|
|
54
|
-
server.listen(port, () => {
|
|
55
|
-
console.log(`Node Express server listening on http://localhost:${port}`);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Webpack will replace 'require' with '__webpack_require__'
|
|
60
|
-
// '__non_webpack_require__' is a proxy to Node 'require'
|
|
61
|
-
// The below code is to ensure that the server is run only when not requiring the bundle.
|
|
62
|
-
declare const __non_webpack_require__: NodeRequire;
|
|
63
|
-
const mainModule = __non_webpack_require__.main;
|
|
64
|
-
const moduleFilename = mainModule && mainModule.filename || '';
|
|
65
|
-
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
|
|
66
|
-
run();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
|
2
|
-
import { AppComponent } from './app/app.component';
|
|
3
|
-
import { config } from './app/app.config.server';
|
|
4
|
-
|
|
5
|
-
<%_ if (useBootstrapContext) { _%>
|
|
6
|
-
const bootstrap = (context: BootstrapContext) =>
|
|
7
|
-
bootstrapApplication(AppComponent, config, context);
|
|
8
|
-
<%_ } else { _%>
|
|
9
|
-
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
|
10
|
-
<%_ } _%>
|
|
11
|
-
|
|
12
|
-
export default bootstrap;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
|
|
2
|
-
import { provideServerRendering } from '@angular/platform-server';
|
|
3
|
-
import { appConfig } from './app.config';
|
|
4
|
-
|
|
5
|
-
const serverConfig: ApplicationConfig = {
|
|
6
|
-
providers: [
|
|
7
|
-
provideServerRendering()
|
|
8
|
-
]
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const config = mergeApplicationConfig(appConfig, serverConfig);
|