@nx/angular 17.1.0-beta.0 → 17.1.0-beta.3

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.
Files changed (190) hide show
  1. package/fesm2022/nx-angular.mjs +1 -1
  2. package/migrations.json +135 -0
  3. package/ng-package.json +0 -1
  4. package/package.json +15 -20
  5. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +1 -1
  6. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +112 -60
  7. package/src/builders/module-federation-dev-server/schema.d.ts +23 -7
  8. package/src/builders/module-federation-dev-server/schema.json +13 -3
  9. package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.d.ts +1 -1
  10. package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +13 -8
  11. package/src/builders/webpack-browser/schema.json +7 -7
  12. package/src/builders/webpack-browser/webpack-browser.impl.js +0 -2
  13. package/src/builders/webpack-dev-server/lib/normalize-options.d.ts +2 -2
  14. package/src/builders/webpack-dev-server/lib/normalize-options.js +11 -5
  15. package/src/builders/webpack-dev-server/schema.d.ts +22 -7
  16. package/src/builders/webpack-dev-server/schema.json +9 -3
  17. package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +24 -13
  18. package/src/builders/webpack-server/schema.d.ts +0 -1
  19. package/src/builders/webpack-server/schema.json +1 -13
  20. package/src/builders/webpack-server/validate-options.js +0 -7
  21. package/src/builders/webpack-server/webpack-server.impl.js +0 -8
  22. package/src/executors/browser-esbuild/browser-esbuild.impl.js +0 -2
  23. package/src/executors/browser-esbuild/schema.json +5 -4
  24. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.js +20 -12
  25. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ngc/compile-source-files.js +10 -1
  26. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/styles/stylesheet-processor.js +0 -13
  27. package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +10 -1
  28. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +0 -13
  29. package/src/executors/utilities/ng-compiler-cli.d.ts +15 -0
  30. package/src/executors/utilities/ng-compiler-cli.js +28 -0
  31. package/src/generators/application/application.js +7 -17
  32. package/src/generators/application/files/base/tsconfig.app.json__tpl__ +1 -1
  33. package/src/generators/application/files/base/tsconfig.json__tpl__ +3 -2
  34. package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +1 -1
  35. package/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -2
  36. package/src/generators/application/files/ng-module/src/main.ts__tpl__ +2 -8
  37. package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +2 -2
  38. package/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +2 -2
  39. package/src/generators/application/lib/add-e2e.js +7 -1
  40. package/src/generators/application/lib/add-unit-test-runner.js +11 -1
  41. package/src/generators/application/lib/create-files.js +10 -5
  42. package/src/generators/application/lib/create-project.js +46 -38
  43. package/src/generators/application/lib/normalize-options.d.ts +1 -1
  44. package/src/generators/application/lib/normalize-options.js +14 -3
  45. package/src/generators/application/lib/normalized-schema.d.ts +2 -0
  46. package/src/generators/application/schema.d.ts +1 -0
  47. package/src/generators/application/schema.json +13 -6
  48. package/src/generators/component/component.js +0 -1
  49. package/src/generators/component/lib/index.d.ts +0 -1
  50. package/src/generators/component/lib/index.js +0 -1
  51. package/src/generators/component/lib/normalize-options.js +1 -0
  52. package/src/generators/component/schema.json +2 -2
  53. package/src/generators/directive/directive.js +0 -1
  54. package/src/generators/directive/lib/index.d.ts +0 -1
  55. package/src/generators/directive/lib/index.js +0 -1
  56. package/src/generators/directive/lib/normalize-options.js +1 -0
  57. package/src/generators/directive/schema.json +2 -2
  58. package/src/generators/federate-module/federate-module.js +1 -0
  59. package/src/generators/federate-module/lib/add-remote.d.ts +1 -1
  60. package/src/generators/federate-module/lib/add-remote.js +2 -11
  61. package/src/generators/federate-module/schema.json +9 -9
  62. package/src/generators/host/files/common/v17+/src/main.server.ts__tmpl__ +67 -0
  63. package/src/generators/host/host.js +5 -9
  64. package/src/generators/host/lib/index.d.ts +1 -1
  65. package/src/generators/host/lib/index.js +1 -1
  66. package/src/generators/host/lib/update-ssr-setup.d.ts +3 -0
  67. package/src/generators/host/lib/{add-ssr.js → update-ssr-setup.js} +8 -14
  68. package/src/generators/host/schema.json +2 -2
  69. package/src/generators/library/lib/normalize-options.js +1 -0
  70. package/src/generators/library/library.js +10 -6
  71. package/src/generators/library/schema.json +12 -12
  72. package/src/generators/ng-add/migrators/projects/app.migrator.js +50 -7
  73. package/src/generators/ngrx/lib/generate-files.js +1 -10
  74. package/src/generators/ngrx/lib/validate-options.js +0 -23
  75. package/src/generators/ngrx/schema.json +2 -2
  76. package/src/generators/ngrx-feature-store/lib/generate-files.js +1 -12
  77. package/src/generators/ngrx-feature-store/lib/validate-options.js +0 -22
  78. package/src/generators/ngrx-feature-store/schema.json +2 -2
  79. package/src/generators/ngrx-root-store/lib/normalize-options.js +1 -1
  80. package/src/generators/ngrx-root-store/lib/validate-options.js +0 -15
  81. package/src/generators/ngrx-root-store/schema.json +1 -1
  82. package/src/generators/pipe/lib/index.d.ts +0 -1
  83. package/src/generators/pipe/lib/index.js +0 -1
  84. package/src/generators/pipe/lib/normalize-options.js +1 -0
  85. package/src/generators/pipe/pipe.js +0 -1
  86. package/src/generators/pipe/schema.json +2 -2
  87. package/src/generators/remote/files/common/v17+/src/main.server.ts__tmpl__ +74 -0
  88. package/src/generators/remote/lib/index.d.ts +1 -1
  89. package/src/generators/remote/lib/index.js +1 -1
  90. package/src/generators/remote/lib/{add-ssr.d.ts → update-ssr-setup.d.ts} +1 -1
  91. package/src/generators/remote/lib/{add-ssr.js → update-ssr-setup.js} +9 -13
  92. package/src/generators/remote/remote.js +4 -9
  93. package/src/generators/remote/schema.json +2 -2
  94. package/src/generators/scam-to-standalone/scam-to-standalone.js +0 -7
  95. package/src/generators/scam-to-standalone/schema.json +1 -1
  96. package/src/generators/setup-mf/lib/add-remote-entry.js +2 -11
  97. package/src/generators/setup-mf/lib/fix-bootstrap.js +3 -12
  98. package/src/generators/setup-mf/lib/index.d.ts +1 -1
  99. package/src/generators/setup-mf/lib/index.js +1 -1
  100. package/src/generators/setup-mf/lib/normalize-options.js +1 -0
  101. package/src/generators/{component/lib/validate-options.d.ts → setup-mf/lib/update-tsconfig.d.ts} +1 -1
  102. package/src/generators/setup-mf/lib/update-tsconfig.js +19 -0
  103. package/src/generators/setup-mf/schema.json +2 -2
  104. package/src/generators/setup-mf/setup-mf.js +1 -7
  105. package/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +54 -0
  106. package/src/generators/setup-ssr/files/{ngmodule/base → server/server-builder/pre-v17}/__serverFileName__ +3 -4
  107. package/src/generators/setup-ssr/files/{standalone → server/server-builder/v17+}/__serverFileName__ +25 -16
  108. package/src/generators/setup-ssr/lib/add-dependencies.d.ts +2 -0
  109. package/src/generators/setup-ssr/lib/add-dependencies.js +32 -0
  110. package/src/generators/setup-ssr/lib/generate-files.d.ts +1 -1
  111. package/src/generators/setup-ssr/lib/generate-files.js +10 -13
  112. package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +4 -0
  113. package/src/generators/setup-ssr/lib/generate-server-ts-config.js +26 -0
  114. package/src/generators/setup-ssr/lib/index.d.ts +3 -0
  115. package/src/generators/setup-ssr/lib/index.js +3 -0
  116. package/src/generators/setup-ssr/lib/normalize-options.js +7 -1
  117. package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +3 -0
  118. package/src/generators/setup-ssr/lib/set-router-initial-navigation.js +93 -0
  119. package/src/generators/setup-ssr/lib/update-project-config.d.ts +2 -1
  120. package/src/generators/setup-ssr/lib/update-project-config.js +24 -6
  121. package/src/generators/setup-ssr/lib/validate-options.js +15 -2
  122. package/src/generators/setup-ssr/schema.json +3 -3
  123. package/src/generators/setup-ssr/setup-ssr.js +16 -12
  124. package/src/generators/utils/create-ts-config.d.ts +1 -0
  125. package/src/generators/utils/create-ts-config.js +2 -3
  126. package/src/generators/utils/project.js +4 -4
  127. package/src/generators/utils/testing.js +12 -0
  128. package/src/generators/utils/validations.d.ts +0 -1
  129. package/src/generators/utils/validations.js +1 -14
  130. package/src/generators/utils/version-utils.js +2 -2
  131. package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts +3 -0
  132. package/src/migrations/update-17-1-0/browser-target-to-build-target.js +50 -0
  133. package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts +2 -0
  134. package/src/migrations/update-17-1-0/replace-nguniversal-builders.js +75 -0
  135. package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts +2 -0
  136. package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +185 -0
  137. package/src/migrations/update-17-1-0/stub-performance-mark-in-jest-test-setup.d.ts +2 -0
  138. package/src/migrations/update-17-1-0/stub-performance-mark-in-jest-test-setup.js +63 -0
  139. package/src/migrations/update-17-1-0/update-angular-cli.d.ts +3 -0
  140. package/src/migrations/update-17-1-0/update-angular-cli.js +23 -0
  141. package/src/utils/backward-compatible-versions.d.ts +1 -1
  142. package/src/utils/backward-compatible-versions.js +18 -18
  143. package/src/utils/nx-devkit/ast-utils.js +4 -2
  144. package/src/utils/versions.d.ts +6 -6
  145. package/src/utils/versions.js +6 -6
  146. package/src/builders/webpack-browser/validate-options.d.ts +0 -2
  147. package/src/builders/webpack-browser/validate-options.js +0 -40
  148. package/src/executors/browser-esbuild/lib/validate-options.d.ts +0 -2
  149. package/src/executors/browser-esbuild/lib/validate-options.js +0 -40
  150. package/src/generators/application/files/tsconfig.editor.json__tpl__ +0 -5
  151. package/src/generators/application/files/v14/.browserlistrc__tpl__ +0 -16
  152. package/src/generators/application/files/v14/src/environments/environment.prod.ts__tpl__ +0 -3
  153. package/src/generators/application/files/v14/src/environments/environment.ts__tpl__ +0 -16
  154. package/src/generators/application/files/v14/src/polyfills.ts__tpl__ +0 -53
  155. package/src/generators/component/lib/validate-options.js +0 -8
  156. package/src/generators/directive/lib/validate-options.d.ts +0 -3
  157. package/src/generators/directive/lib/validate-options.js +0 -8
  158. package/src/generators/host/lib/add-ssr.d.ts +0 -3
  159. package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +0 -22
  160. package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +0 -27
  161. package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +0 -22
  162. package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +0 -27
  163. package/src/generators/pipe/lib/validate-options.d.ts +0 -3
  164. package/src/generators/pipe/lib/validate-options.js +0 -8
  165. package/src/generators/setup-mf/lib/set-tsconfig-target.d.ts +0 -3
  166. package/src/generators/setup-mf/lib/set-tsconfig-target.js +0 -16
  167. package/src/generators/setup-ssr/files/ngmodule/v14/src/__main__ +0 -11
  168. /package/src/generators/host/files/common/{src → pre-v17/src}/main.server.ts__tmpl__ +0 -0
  169. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.actions.ts__tmpl__ +0 -0
  170. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
  171. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.effects.ts__tmpl__ +0 -0
  172. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
  173. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.facade.ts__tmpl__ +0 -0
  174. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.models.ts__tmpl__ +0 -0
  175. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
  176. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
  177. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.selectors.spec.ts__tmpl__ +0 -0
  178. /package/src/generators/ngrx/files/{base/__directory__ → __directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
  179. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.actions.ts__tmpl__ +0 -0
  180. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
  181. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.effects.ts__tmpl__ +0 -0
  182. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
  183. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.facade.ts__tmpl__ +0 -0
  184. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.models.ts__tmpl__ +0 -0
  185. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
  186. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
  187. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.selectors.spec.ts__tmpl__ +0 -0
  188. /package/src/generators/ngrx-feature-store/files/{base/__directory__ → __directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
  189. /package/src/generators/remote/files/common/{src → pre-v17/src}/main.server.ts__tmpl__ +0 -0
  190. /package/src/generators/setup-ssr/files/{base → root}/tsconfig.server.json__tpl__ +0 -0
@@ -11,7 +11,6 @@ const rxjs_1 = require("rxjs");
11
11
  const operators_2 = require("rxjs/operators");
12
12
  const buildable_libs_1 = require("../utilities/buildable-libs");
13
13
  const webpack_1 = require("../utilities/webpack");
14
- const validate_options_1 = require("./validate-options");
15
14
  function shouldSkipInitialTargetRun(projectGraph, project, target) {
16
15
  const nxJson = (0, configuration_1.readNxJson)();
17
16
  const defaultDependencyConfigs = Object.entries(nxJson.targetDefaults ?? {}).reduce((acc, [targetName, dependencyConfig]) => {
@@ -23,7 +22,6 @@ function shouldSkipInitialTargetRun(projectGraph, project, target) {
23
22
  return projectDependencyConfigs.some((d) => d.target === target && d.projects === 'dependencies');
24
23
  }
25
24
  function executeWebpackBrowserBuilder(options, context) {
26
- (0, validate_options_1.validateOptions)(options);
27
25
  options.buildLibsFromSource ??= true;
28
26
  const { buildLibsFromSource, customWebpackConfig, indexFileTransformer, ...delegateBuilderOptions } = options;
29
27
  const pathToWebpackConfig = customWebpackConfig?.path &&
@@ -1,2 +1,2 @@
1
- import type { Schema } from '../schema';
2
- export declare function normalizeOptions(schema: Schema): Schema;
1
+ import type { NormalizedSchema, Schema } from '../schema';
2
+ export declare function normalizeOptions(schema: Schema): NormalizedSchema;
@@ -2,13 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = void 0;
4
4
  function normalizeOptions(schema) {
5
+ let buildTarget = schema.buildTarget;
6
+ if (schema.browserTarget) {
7
+ buildTarget ??= schema.browserTarget;
8
+ delete schema.browserTarget;
9
+ }
5
10
  return {
6
- host: 'localhost',
7
- port: 4200,
8
- liveReload: true,
9
- open: false,
10
- ssl: false,
11
11
  ...schema,
12
+ buildTarget,
13
+ host: schema.host ?? 'localhost',
14
+ port: schema.port ?? 4200,
15
+ liveReload: schema.liveReload ?? true,
16
+ open: schema.open ?? false,
17
+ ssl: schema.ssl ?? false,
12
18
  };
13
19
  }
14
20
  exports.normalizeOptions = normalizeOptions;
@@ -1,15 +1,14 @@
1
- export interface Schema {
2
- browserTarget: string;
3
- port: number;
4
- host: string;
1
+ interface BaseSchema {
2
+ port?: number;
3
+ host?: string;
5
4
  proxyConfig?: string;
6
- ssl: boolean;
5
+ ssl?: boolean;
7
6
  sslKey?: string;
8
7
  sslCert?: string;
9
8
  headers?: Record<string, string>;
10
- open: boolean;
9
+ open?: boolean;
11
10
  verbose?: boolean;
12
- liveReload: boolean;
11
+ liveReload?: boolean;
13
12
  publicHost?: string;
14
13
  allowedHosts?: string[];
15
14
  servePath?: string;
@@ -19,3 +18,19 @@ export interface Schema {
19
18
  poll?: number;
20
19
  buildLibsFromSource?: boolean;
21
20
  }
21
+
22
+ export type SchemaWithBrowserTarget = BaseSchema & {
23
+ browserTarget: string;
24
+ };
25
+
26
+ export type SchemaWithBuildTarget = BaseSchema & {
27
+ buildTarget: string;
28
+ };
29
+
30
+ export type Schema = SchemaWithBrowserTarget | SchemaWithBuildTarget;
31
+
32
+ export type NormalizedSchema = SchemaWithBuildTarget & {
33
+ liveReload: boolean;
34
+ open: boolean;
35
+ ssl: boolean;
36
+ };
@@ -9,13 +9,19 @@
9
9
  "presets": [
10
10
  {
11
11
  "name": "Using a Different Port",
12
- "keys": ["browserTarget", "port"]
12
+ "keys": ["buildTarget", "port"]
13
13
  }
14
14
  ],
15
15
  "properties": {
16
16
  "browserTarget": {
17
17
  "type": "string",
18
- "description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
18
+ "description": "A browser builder target to serve in the format of `project:target[:configuration]`. Ignored if `buildTarget` is set.",
19
+ "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
20
+ "x-deprecated": "Use 'buildTarget' instead. It will be removed in Nx v18."
21
+ },
22
+ "buildTarget": {
23
+ "type": "string",
24
+ "description": "A build builder target to serve in the format of `project:target[:configuration]`.",
19
25
  "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
20
26
  },
21
27
  "port": {
@@ -112,5 +118,5 @@
112
118
  }
113
119
  },
114
120
  "additionalProperties": false,
115
- "required": ["browserTarget"]
121
+ "anyOf": [{ "required": ["buildTarget"] }, { "required": ["browserTarget"] }]
116
122
  }
@@ -2,32 +2,33 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.executeWebpackDevServerBuilder = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const js_1 = require("@nx/js");
5
6
  const webpack_nx_build_coordination_plugin_1 = require("@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin");
6
- const project_graph_1 = require("nx/src/project-graph/project-graph");
7
7
  const fs_1 = require("fs");
8
8
  const operators_1 = require("nx/src/project-graph/operators");
9
- const webpack_1 = require("../utilities/webpack");
10
- const lib_1 = require("./lib");
11
- const buildable_libs_1 = require("../utilities/buildable-libs");
9
+ const project_graph_1 = require("nx/src/project-graph/project-graph");
12
10
  const rxjs_1 = require("rxjs");
13
11
  const operators_2 = require("rxjs/operators");
14
- const js_1 = require("@nx/js");
12
+ const angular_version_utils_1 = require("../../executors/utilities/angular-version-utils");
13
+ const buildable_libs_1 = require("../utilities/buildable-libs");
14
+ const webpack_1 = require("../utilities/webpack");
15
+ const lib_1 = require("./lib");
15
16
  function executeWebpackDevServerBuilder(rawOptions, context) {
16
17
  process.env.NX_TSCONFIG_PATH = (0, js_1.getRootTsConfigPath)();
17
18
  const options = (0, lib_1.normalizeOptions)(rawOptions);
18
- const parsedBrowserTarget = (0, devkit_1.parseTargetString)(options.browserTarget, {
19
+ const parsedBuildTarget = (0, devkit_1.parseTargetString)(options.buildTarget, {
19
20
  cwd: context.currentDirectory,
20
21
  projectGraph: (0, devkit_1.readCachedProjectGraph)(),
21
22
  projectName: context.target.project,
22
23
  root: context.workspaceRoot,
23
24
  isVerbose: false,
24
25
  });
25
- const browserTargetProjectConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(parsedBrowserTarget.project);
26
- const buildTarget = browserTargetProjectConfiguration.targets[parsedBrowserTarget.target];
26
+ const browserTargetProjectConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(parsedBuildTarget.project);
27
+ const buildTarget = browserTargetProjectConfiguration.targets[parsedBuildTarget.target];
27
28
  const buildTargetOptions = {
28
29
  ...buildTarget.options,
29
- ...(parsedBrowserTarget.configuration
30
- ? buildTarget.configurations[parsedBrowserTarget.configuration]
30
+ ...(parsedBuildTarget.configuration
31
+ ? buildTarget.configurations[parsedBuildTarget.configuration]
31
32
  : buildTarget.defaultConfiguration
32
33
  ? buildTarget.configurations[buildTarget.defaultConfiguration]
33
34
  : {}),
@@ -52,7 +53,7 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
52
53
  let dependencies;
53
54
  if (!buildLibsFromSource) {
54
55
  const { tsConfigPath, dependencies: foundDependencies } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(buildTargetOptions.tsConfig, context, {
55
- target: parsedBrowserTarget.target,
56
+ target: parsedBuildTarget.target,
56
57
  });
57
58
  dependencies = foundDependencies;
58
59
  // We can't just pass the tsconfig path in memory to the angular builder
@@ -73,7 +74,8 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
73
74
  // webpack-server implementation.
74
75
  buildTargetOptions.tsConfig = tsConfigPath;
75
76
  }
76
- return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_2.switchMap)(({ executeDevServerBuilder }) => executeDevServerBuilder(options, context, {
77
+ const delegateBuilderOptions = getDelegateBuilderOptions(options);
78
+ return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_2.switchMap)(({ executeDevServerBuilder }) => executeDevServerBuilder(delegateBuilderOptions, context, {
77
79
  webpackConfiguration: async (baseWebpackConfig) => {
78
80
  if (!buildLibsFromSource) {
79
81
  const workspaceDependencies = dependencies
@@ -86,7 +88,7 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
86
88
  if (workspaceDependencies.length > 0) {
87
89
  baseWebpackConfig.plugins.push(
88
90
  // @ts-expect-error - difference between angular and webpack plugin definitions bc of webpack versions
89
- new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${parsedBrowserTarget.target} --projects=${workspaceDependencies.join(',')}`));
91
+ new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${parsedBuildTarget.target} --projects=${workspaceDependencies.join(',')}`));
90
92
  }
91
93
  }
92
94
  if (!pathToWebpackConfig) {
@@ -103,3 +105,12 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
103
105
  }
104
106
  exports.executeWebpackDevServerBuilder = executeWebpackDevServerBuilder;
105
107
  exports.default = require('@angular-devkit/architect').createBuilder(executeWebpackDevServerBuilder);
108
+ function getDelegateBuilderOptions(options) {
109
+ const delegatedBuilderOptions = { ...options };
110
+ const { major } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
111
+ if (major <= 17) {
112
+ delegatedBuilderOptions.browserTarget = delegatedBuilderOptions.buildTarget;
113
+ delete delegatedBuilderOptions.buildTarget;
114
+ }
115
+ return delegatedBuilderOptions;
116
+ }
@@ -5,5 +5,4 @@ export interface Schema extends ServerBuilderOptions {
5
5
  path: string;
6
6
  };
7
7
  buildLibsFromSource?: boolean;
8
- bundleDependencies?: boolean | 'none' | 'all';
9
8
  }
@@ -128,7 +128,7 @@
128
128
  },
129
129
  "vendorChunk": {
130
130
  "type": "boolean",
131
- "description": "Generate a seperate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time. _Note: supported in Angular versions >= 15.1.0_",
131
+ "description": "Generate a separate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time. _Note: supported in Angular versions >= 15.1.0_",
132
132
  "default": false
133
133
  },
134
134
  "verbose": {
@@ -209,18 +209,6 @@
209
209
  },
210
210
  "default": []
211
211
  },
212
- "bundleDependencies": {
213
- "description": "Which external dependencies to bundle into the bundle. By default, all of node_modules will be bundled. _Note: This is only supported in Angular versions >= 14.0.0, < 15.0.0. It was removed in Angular 15._",
214
- "oneOf": [
215
- {
216
- "type": "boolean"
217
- },
218
- {
219
- "type": "string",
220
- "enum": ["none", "all"]
221
- }
222
- ]
223
- },
224
212
  "statsJson": {
225
213
  "type": "boolean",
226
214
  "description": "Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.",
@@ -8,7 +8,6 @@ function validateOptions(options) {
8
8
  const angularVersionInfo = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
9
9
  validateAssets(options, angularVersionInfo);
10
10
  validateBuildOptimizer(options, angularVersionInfo);
11
- validateBundleDependencies(options, angularVersionInfo);
12
11
  validateVendorChunk(options, angularVersionInfo);
13
12
  }
14
13
  exports.validateOptions = validateOptions;
@@ -26,12 +25,6 @@ function validateBuildOptimizer(options, { major, version }) {
26
25
  You can resolve this error by removing the "buildOptimizer" option.`);
27
26
  }
28
27
  }
29
- function validateBundleDependencies(options, { major, version }) {
30
- if (major >= 15 && options.bundleDependencies) {
31
- throw new Error((0, devkit_1.stripIndents) `The "bundleDependencies" option was removed in Angular version 15. You are currently using "${version}".
32
- You can resolve this error by removing the "bundleDependencies" option.`);
33
- }
34
- }
35
28
  function validateVendorChunk(options, { version }) {
36
29
  if ((0, semver_1.lt)(version, '15.1.0') && options.vendorChunk) {
37
30
  throw new Error((0, devkit_1.stripIndents) `The "vendorChunk" option is supported from Angular >= 15.1.0. You are currently using "${version}".
@@ -5,8 +5,6 @@ const devkit_1 = require("@nx/devkit");
5
5
  const fs_1 = require("fs");
6
6
  const rxjs_1 = require("rxjs");
7
7
  const operators_1 = require("rxjs/operators");
8
- const semver_1 = require("semver");
9
- const angular_version_utils_1 = require("../../executors/utilities/angular-version-utils");
10
8
  const buildable_libs_1 = require("../utilities/buildable-libs");
11
9
  const webpack_1 = require("../utilities/webpack");
12
10
  const validate_options_1 = require("./validate-options");
@@ -49,12 +47,6 @@ function buildServerAppWithCustomWebpackConfiguration(options, context, pathToWe
49
47
  }
50
48
  function executeWebpackServerBuilder(options, context) {
51
49
  (0, validate_options_1.validateOptions)(options);
52
- const installedAngularVersionInfo = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
53
- // default bundleDependencies to true if supported by Angular version
54
- if ((0, semver_1.lt)(installedAngularVersionInfo.version, '15.0.0') &&
55
- options.bundleDependencies === undefined) {
56
- options.bundleDependencies = true;
57
- }
58
50
  options.buildLibsFromSource ??= true;
59
51
  if (!options.buildLibsFromSource) {
60
52
  const { tsConfigPath } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(options.tsConfig, context);
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const validate_options_1 = require("./lib/validate-options");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const buildable_libs_1 = require("./lib/buildable-libs");
6
5
  const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
7
6
  async function* esbuildExecutor(options, context) {
8
- (0, validate_options_1.validateOptions)(options);
9
7
  options.buildLibsFromSource ??= true;
10
8
  const { buildLibsFromSource, ...delegateExecutorOptions } = options;
11
9
  let dependencies;
@@ -215,7 +215,7 @@
215
215
  },
216
216
  "outputPath": {
217
217
  "type": "string",
218
- "description": "The full path for the new output directory, relative to the current workspace.\nBy default, writes output to a folder named dist/ in the current project."
218
+ "description": "The full path for the new output directory, relative to the current workspace."
219
219
  },
220
220
  "resourcesOutputPath": {
221
221
  "type": "string",
@@ -264,12 +264,12 @@
264
264
  },
265
265
  "vendorChunk": {
266
266
  "type": "boolean",
267
- "description": "Generate a seperate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
267
+ "description": "Generate a separate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
268
268
  "default": false
269
269
  },
270
270
  "commonChunk": {
271
271
  "type": "boolean",
272
- "description": "Generate a seperate bundle containing code used across multiple bundles.",
272
+ "description": "Generate a separate bundle containing code used across multiple bundles.",
273
273
  "default": true
274
274
  },
275
275
  "baseHref": {
@@ -401,6 +401,7 @@
401
401
  },
402
402
  {
403
403
  "const": false,
404
+ "type": "boolean",
404
405
  "description": "Does not generate an `index.html` file."
405
406
  }
406
407
  ]
@@ -429,7 +430,7 @@
429
430
  "enum": ["none", "anonymous", "use-credentials"]
430
431
  },
431
432
  "allowedCommonJsDependencies": {
432
- "description": "A list of CommonJS packages that are allowed to be used without a build time warning.",
433
+ "description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all.",
433
434
  "type": "array",
434
435
  "items": {
435
436
  "type": "string"
@@ -34,11 +34,14 @@ const nxWritePackageTransform = (options) => (0, transform_1.transformFromPromis
34
34
  }
35
35
  }
36
36
  // 6. WRITE PACKAGE.JSON
37
- // As of APF 14 only the primary entrypoint has a package.json
37
+ const relativeUnixFromDestPath = (filePath) => (0, path_1.ensureUnixPath)(path.relative(ngEntryPoint.destinationPath, filePath));
38
38
  if (!ngEntryPoint.isSecondaryEntryPoint) {
39
39
  try {
40
40
  devkit_1.logger.info('Writing package manifest');
41
- const relativeUnixFromDestPath = (filePath) => (0, path_1.ensureUnixPath)(path.relative(ngEntryPoint.destinationPath, filePath));
41
+ if (!options.watch) {
42
+ const primary = ngPackageNode.data.primary;
43
+ await (0, fs_1.writeFile)(path.join(primary.destinationPath, '.npmignore'), `# Nested package.json's are only needed for development.\n**/package.json`);
44
+ }
42
45
  await writePackageJson(ngEntryPoint, ngPackage, {
43
46
  // backward compat for Angular < 16
44
47
  ...(angularVersion.major < 16
@@ -60,17 +63,22 @@ const nxWritePackageTransform = (options) => (0, transform_1.transformFromPromis
60
63
  throw error;
61
64
  }
62
65
  }
63
- else if (options.watch) {
64
- // update the watch version of the primary entry point `package.json` file.
65
- // this is needed because of Webpack's 5 `cachemanagedpaths`
66
- // https://github.com/ng-packagr/ng-packagr/issues/2069
67
- const primary = ngPackageNode.data.primary;
68
- const packageJsonPath = path.join(primary.destinationPath, 'package.json');
69
- if (await (0, fs_1.exists)(packageJsonPath)) {
70
- const packageJson = JSON.parse(await (0, fs_1.readFile)(packageJsonPath, { encoding: 'utf8' }));
71
- packageJson.version = generateWatchVersion();
72
- await (0, fs_1.writeFile)(path.join(primary.destinationPath, 'package.json'), JSON.stringify(packageJson, undefined, 2));
66
+ else if (ngEntryPoint.isSecondaryEntryPoint) {
67
+ if (options.watch) {
68
+ // Update the watch version of the primary entry point `package.json` file.
69
+ // this is needed because of Webpack's 5 `cachemanagedpaths`
70
+ // https://github.com/ng-packagr/ng-packagr/issues/2069
71
+ const primary = ngPackageNode.data.primary;
72
+ const packageJsonPath = path.join(primary.destinationPath, 'package.json');
73
+ if (await (0, fs_1.exists)(packageJsonPath)) {
74
+ const packageJson = JSON.parse(await (0, fs_1.readFile)(packageJsonPath, { encoding: 'utf8' }));
75
+ packageJson.version = generateWatchVersion();
76
+ await (0, fs_1.writeFile)(path.join(primary.destinationPath, 'package.json'), JSON.stringify(packageJson, undefined, 2));
77
+ }
73
78
  }
79
+ // Write a package.json in each secondary entry-point
80
+ // This is need for esbuild to secondary entry-points in dist correctly.
81
+ await (0, fs_1.writeFile)(path.join(ngEntryPoint.destinationPath, 'package.json'), JSON.stringify({ module: relativeUnixFromDestPath(destinationFiles.fesm2022) }, undefined, 2));
74
82
  }
75
83
  devkit_1.logger.info(`Built ${ngEntryPoint.moduleId}`);
76
84
  return graph;
@@ -12,10 +12,10 @@ exports.compileSourceFiles = void 0;
12
12
  const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
13
13
  const cache_compiler_host_1 = require("ng-packagr/lib/ts/cache-compiler-host");
14
14
  const log = require("ng-packagr/lib/utils/log");
15
- const ng_compiler_cli_1 = require("ng-packagr/lib/utils/ng-compiler-cli");
16
15
  const node_path_1 = require("node:path");
17
16
  const ts = require("typescript");
18
17
  const angular_version_utils_1 = require("../../../utilities/angular-version-utils");
18
+ const ng_compiler_cli_1 = require("../../../utilities/ng-compiler-cli");
19
19
  const cache_compiler_host_2 = require("../ts/cache-compiler-host");
20
20
  async function compileSourceFiles(graph, tsConfig, moduleResolutionCache, options, extraOptions, stylesheetProcessor) {
21
21
  const { NgtscProgram, formatDiagnostics } = await (0, ng_compiler_cli_1.ngCompilerCli)();
@@ -155,6 +155,15 @@ async function compileSourceFiles(graph, tsConfig, moduleResolutionCache, option
155
155
  throw new Error(formatDiagnostics(errorDiagnostics));
156
156
  }
157
157
  const transformers = angularCompiler.prepareEmit().transformers;
158
+ if ('getSemanticDiagnosticsOfNextAffectedFile' in builder) {
159
+ while (builder.emitNextAffectedFile((fileName, data, writeByteOrderMark, onError, sourceFiles) => {
160
+ if (fileName.endsWith('.tsbuildinfo')) {
161
+ tsCompilerHost.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles);
162
+ }
163
+ })) {
164
+ // empty
165
+ }
166
+ }
158
167
  const angularVersion = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
159
168
  const incrementalCompilation = angularVersion.major < 16
160
169
  ? angularCompiler.incrementalDriver
@@ -19,7 +19,6 @@ const path_1 = require("path");
19
19
  const postcssPresetEnv = require("postcss-preset-env");
20
20
  const postcssUrl = require("postcss-url");
21
21
  const node_url_1 = require("node:url");
22
- const angular_version_utils_1 = require("../../../utilities/angular-version-utils");
23
22
  const tailwindcss_1 = require("../../../utilities/tailwindcss");
24
23
  const postcss = require('postcss');
25
24
  var CssUrl;
@@ -167,18 +166,6 @@ class StylesheetProcessor {
167
166
  switch (ext) {
168
167
  case '.sass':
169
168
  case '.scss': {
170
- const angularVersion = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
171
- if (angularVersion && angularVersion.major < 15) {
172
- return (await Promise.resolve().then(() => require('sass')))
173
- .renderSync({
174
- file: filePath,
175
- data: css,
176
- indentedSyntax: '.sass' === ext,
177
- importer: customSassImporter,
178
- includePaths: this.styleIncludePaths,
179
- })
180
- .css.toString();
181
- }
182
169
  return (await Promise.resolve().then(() => require('sass')))
183
170
  .compileString(css, {
184
171
  url: (0, node_url_1.pathToFileURL)(filePath),
@@ -11,10 +11,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.compileSourceFiles = void 0;
12
12
  const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
13
13
  const log = require("ng-packagr/lib/utils/log");
14
- const ng_compiler_cli_1 = require("ng-packagr/lib/utils/ng-compiler-cli");
15
14
  const node_path_1 = require("node:path");
16
15
  const ts = require("typescript");
17
16
  const angular_version_utils_1 = require("../../../utilities/angular-version-utils");
17
+ const ng_compiler_cli_1 = require("../../../utilities/ng-compiler-cli");
18
18
  const cache_compiler_host_1 = require("../ts/cache-compiler-host");
19
19
  async function compileSourceFiles(graph, tsConfig, moduleResolutionCache, options, extraOptions, stylesheetProcessor, ngccProcessor) {
20
20
  const { NgtscProgram, formatDiagnostics } = await (0, ng_compiler_cli_1.ngCompilerCli)();
@@ -158,6 +158,15 @@ async function compileSourceFiles(graph, tsConfig, moduleResolutionCache, option
158
158
  throw new Error(formatDiagnostics(errorDiagnostics));
159
159
  }
160
160
  const transformers = angularCompiler.prepareEmit().transformers;
161
+ if ('getSemanticDiagnosticsOfNextAffectedFile' in builder) {
162
+ while (builder.emitNextAffectedFile((fileName, data, writeByteOrderMark, onError, sourceFiles) => {
163
+ if (fileName.endsWith('.tsbuildinfo')) {
164
+ tsCompilerHost.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles);
165
+ }
166
+ })) {
167
+ // empty
168
+ }
169
+ }
161
170
  const angularVersion = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
162
171
  const incrementalCompilation = angularVersion.major < 16
163
172
  ? angularCompiler.incrementalDriver
@@ -19,7 +19,6 @@ const path_1 = require("path");
19
19
  const postcssPresetEnv = require("postcss-preset-env");
20
20
  const postcssUrl = require("postcss-url");
21
21
  const node_url_1 = require("node:url");
22
- const angular_version_utils_1 = require("../../../utilities/angular-version-utils");
23
22
  const tailwindcss_1 = require("../../../utilities/tailwindcss");
24
23
  const postcss = require('postcss');
25
24
  var CssUrl;
@@ -160,18 +159,6 @@ class StylesheetProcessor {
160
159
  switch (ext) {
161
160
  case '.sass':
162
161
  case '.scss': {
163
- const angularVersion = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
164
- if (angularVersion && angularVersion.major < 15) {
165
- return (await Promise.resolve().then(() => require('sass')))
166
- .renderSync({
167
- file: filePath,
168
- data: css,
169
- indentedSyntax: '.sass' === ext,
170
- importer: customSassImporter,
171
- includePaths: this.styleIncludePaths,
172
- })
173
- .css.toString();
174
- }
175
162
  return (await Promise.resolve().then(() => require('sass')))
176
163
  .compileString(css, {
177
164
  url: (0, node_url_1.pathToFileURL)(filePath),
@@ -0,0 +1,15 @@
1
+ /// <reference types="node" />
2
+ export declare function ngCompilerCli(): Promise<typeof import('@angular/compiler-cli')>;
3
+ /**
4
+ * This uses a dynamic import to load a module which may be ESM.
5
+ * CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
6
+ * will currently, unconditionally downlevel dynamic import into a require call.
7
+ * require calls cannot load ESM code and will result in a runtime error. To workaround
8
+ * this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
9
+ * Once TypeScript provides support for keeping the dynamic import this workaround can
10
+ * be dropped.
11
+ *
12
+ * @param modulePath The path of the module to load.
13
+ * @returns A Promise that resolves to the dynamically imported module.
14
+ */
15
+ export declare function loadEsmModule<T>(modulePath: string | URL): Promise<T>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadEsmModule = exports.ngCompilerCli = void 0;
4
+ function ngCompilerCli() {
5
+ return loadEsmModule('@angular/compiler-cli');
6
+ }
7
+ exports.ngCompilerCli = ngCompilerCli;
8
+ /**
9
+ * Lazily compiled dynamic import loader function.
10
+ */
11
+ let load;
12
+ /**
13
+ * This uses a dynamic import to load a module which may be ESM.
14
+ * CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
15
+ * will currently, unconditionally downlevel dynamic import into a require call.
16
+ * require calls cannot load ESM code and will result in a runtime error. To workaround
17
+ * this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
18
+ * Once TypeScript provides support for keeping the dynamic import this workaround can
19
+ * be dropped.
20
+ *
21
+ * @param modulePath The path of the module to load.
22
+ * @returns A Promise that resolves to the dynamically imported module.
23
+ */
24
+ function loadEsmModule(modulePath) {
25
+ load ??= new Function('modulePath', `return import(modulePath);`);
26
+ return load(modulePath);
27
+ }
28
+ exports.loadEsmModule = loadEsmModule;
@@ -3,11 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.applicationGeneratorInternal = exports.applicationGenerator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const init_1 = require("../init/init");
6
+ const setup_ssr_1 = require("../setup-ssr/setup-ssr");
6
7
  const setup_tailwind_1 = require("../setup-tailwind/setup-tailwind");
7
- const version_utils_1 = require("../utils/version-utils");
8
8
  const lib_1 = require("./lib");
9
- const semver_1 = require("semver");
10
- const enquirer_1 = require("enquirer");
11
9
  async function applicationGenerator(tree, schema) {
12
10
  return await applicationGeneratorInternal(tree, {
13
11
  projectNameAndRootFormat: 'derived',
@@ -16,20 +14,6 @@ async function applicationGenerator(tree, schema) {
16
14
  }
17
15
  exports.applicationGenerator = applicationGenerator;
18
16
  async function applicationGeneratorInternal(tree, schema) {
19
- const installedAngularVersionInfo = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
20
- if ((0, semver_1.lt)(installedAngularVersionInfo.version, '14.1.0') && schema.standalone) {
21
- throw new Error((0, devkit_1.stripIndents) `The "standalone" option is only supported in Angular >= 14.1.0. You are currently using ${installedAngularVersionInfo.version}.
22
- You can resolve this error by removing the "standalone" option or by migrating to Angular 14.1.0.`);
23
- }
24
- if ((0, semver_1.gte)(installedAngularVersionInfo.version, '14.1.0') &&
25
- schema.standalone === undefined &&
26
- process.env.NX_INTERACTIVE === 'true') {
27
- schema.standalone = await (0, enquirer_1.prompt)({
28
- name: 'standalone-components',
29
- message: 'Would you like to use Standalone Components?',
30
- type: 'confirm',
31
- }).then((a) => a['standalone-components']);
32
- }
33
17
  const options = await (0, lib_1.normalizeOptions)(tree, schema);
34
18
  const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
35
19
  await (0, init_1.angularInitGenerator)(tree, {
@@ -63,6 +47,12 @@ async function applicationGeneratorInternal(tree, schema) {
63
47
  else {
64
48
  (0, lib_1.setApplicationStrictDefault)(tree, false);
65
49
  }
50
+ if (options.ssr) {
51
+ await (0, setup_ssr_1.setupSsr)(tree, {
52
+ project: options.name,
53
+ standalone: options.standalone,
54
+ });
55
+ }
66
56
  if (!options.skipFormat) {
67
57
  await (0, devkit_1.formatFiles)(tree);
68
58
  }
@@ -4,7 +4,7 @@
4
4
  "outDir": "<%= rootOffset %>dist/out-tsc",
5
5
  "types": []
6
6
  },
7
- "files": ["src/main.ts"<% if(installedAngularInfo.major === 14) { %>, "src/polyfills.ts"<% } %>],
7
+ "files": ["src/main.ts"],
8
8
  "include": ["src/**/*.d.ts"],
9
9
  "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
10
10
  }
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": <% if(installedAngularInfo.major === 14) { %>"es2020"<% } else { %>"es2022"<% } %><% if(installedAngularInfo.major === 15) { %>,
4
- "useDefineForClassFields": false<% } %>
3
+ "target": "es2022",
4
+ "useDefineForClassFields": false<% if (isUsingApplicationBuilder) { %>,
5
+ "esModuleInterop": true<% } %>
5
6
  },
6
7
  "files": [],
7
8
  "include": [],
@@ -9,7 +9,7 @@ import { NxWelcomeComponent } from './nx-welcome.component';<% } %>
9
9
  declarations: [AppComponent<% if(!minimal) { %>, NxWelcomeComponent<% } %>],
10
10
  imports: [
11
11
  BrowserModule,<% if(routing) { %>
12
- RouterModule.forRoot(appRoutes, { initialNavigation: 'enabledBlocking' }),<% } %>
12
+ RouterModule.forRoot(appRoutes),<% } %>
13
13
  ],
14
14
  providers: [],
15
15
  bootstrap: [AppComponent],