@angular/pwa 20.0.0-next.8 → 20.0.0-rc.0

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 (2) hide show
  1. package/package.json +5 -5
  2. package/pwa/index.js +14 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/pwa",
3
- "version": "20.0.0-next.8",
3
+ "version": "20.0.0-rc.0",
4
4
  "description": "PWA schematics for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -17,12 +17,12 @@
17
17
  "save": false
18
18
  },
19
19
  "dependencies": {
20
- "@angular-devkit/schematics": "20.0.0-next.8",
21
- "@schematics/angular": "20.0.0-next.8",
20
+ "@angular-devkit/schematics": "20.0.0-rc.0",
21
+ "@schematics/angular": "20.0.0-rc.0",
22
22
  "parse5-html-rewriting-stream": "7.1.0"
23
23
  },
24
24
  "peerDependencies": {
25
- "@angular/cli": "^20.0.0-next.8"
25
+ "@angular/cli": "^20.0.0-rc.0"
26
26
  },
27
27
  "peerDependenciesMeta": {
28
28
  "@angular/cli": {
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "packageManager": "pnpm@9.15.6",
37
37
  "engines": {
38
- "node": "^20.11.1 || >=22.11.0",
38
+ "node": "^20.11.1 || ^22.11.0 || >=24.0.0",
39
39
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
40
40
  "yarn": ">= 1.13.0"
41
41
  },
package/pwa/index.js CHANGED
@@ -79,10 +79,14 @@ function default_1(options) {
79
79
  }
80
80
  // Find all index.html files in build targets
81
81
  const indexFiles = new Set();
82
+ let checkForDefaultIndex = false;
82
83
  for (const target of buildTargets) {
83
84
  if (typeof target.options?.index === 'string') {
84
85
  indexFiles.add(target.options.index);
85
86
  }
87
+ else if (target.options?.index === undefined) {
88
+ checkForDefaultIndex = true;
89
+ }
86
90
  if (!target.configurations) {
87
91
  continue;
88
92
  }
@@ -90,10 +94,20 @@ function default_1(options) {
90
94
  if (typeof options?.index === 'string') {
91
95
  indexFiles.add(options.index);
92
96
  }
97
+ else if (options?.index === undefined) {
98
+ checkForDefaultIndex = true;
99
+ }
93
100
  }
94
101
  }
95
102
  // Setup sources for the assets files to add to the project
96
103
  const sourcePath = project.sourceRoot ?? node_path_1.posix.join(project.root, 'src');
104
+ // Check for a default index file if a configuration path allows for a default usage
105
+ if (checkForDefaultIndex) {
106
+ const defaultIndexFile = node_path_1.posix.join(sourcePath, 'index.html');
107
+ if (host.exists(defaultIndexFile)) {
108
+ indexFiles.add(defaultIndexFile);
109
+ }
110
+ }
97
111
  // Setup service worker schematic options
98
112
  const { title, ...swOptions } = options;
99
113
  await (0, utility_1.writeWorkspace)(host, workspace);