@nx/angular-rspack 22.7.0-pr.34971.73bed1f → 22.7.0-pr.35356.e1b62ce

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.
@@ -1 +1 @@
1
- {"version":3,"file":"common-config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config-utils/common-config.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,UAAU,EACV,WAAW,EACX,oCAAoC,EACrC,MAAM,cAAc,CAAC;AAQtB,wBAAsB,eAAe,CACnC,iBAAiB,EAAE,oCAAoC,EACvD,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,EAC/B,UAAU,EAAE,UAAU,iDAoKvB"}
1
+ {"version":3,"file":"common-config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config/config-utils/common-config.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,UAAU,EACV,WAAW,EACX,oCAAoC,EACrC,MAAM,cAAc,CAAC;AAQtB,wBAAsB,eAAe,CACnC,iBAAiB,EAAE,oCAAoC,EACvD,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,EAC/B,UAAU,EAAE,UAAU,iDA6KvB"}
@@ -61,9 +61,15 @@ async function getCommonConfig(normalizedOptions, i18n, i18nHash, hashFormat) {
61
61
  tsConfig: {
62
62
  configFile: normalizedOptions.tsConfig,
63
63
  },
64
- ...(i18n.shouldInline && normalizedOptions.aot
65
- ? { alias: { '@angular/localize/init': false } }
66
- : {}),
64
+ alias: {
65
+ ...(i18n.shouldInline && normalizedOptions.aot
66
+ ? { '@angular/localize/init': false }
67
+ : {}),
68
+ ...(normalizedOptions.fileReplacements?.reduce((aliases, replacement) => ({
69
+ ...aliases,
70
+ [replacement.replace]: replacement.with,
71
+ }), {}) ?? {}),
72
+ },
67
73
  },
68
74
  resolveLoader: {
69
75
  symlinks: !normalizedOptions.preserveSymlinks,
@@ -1 +1 @@
1
- {"version":3,"file":"angular-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/angular-rspack-plugin.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,oCAAoC,EAC1C,MAAM,WAAW,CAAC;AAUnB,qBAAa,mBAAoB,YAAW,oBAAoB;;gBAU5D,OAAO,EAAE,oCAAoC,EAC7C,WAAW,CAAC,EAAE,WAAW;IAuB3B,KAAK,CAAC,QAAQ,EAAE,QAAQ;YAgVV,gBAAgB;CAkC/B"}
1
+ {"version":3,"file":"angular-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/plugins/angular-rspack-plugin.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,QAAQ,EAEb,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,oCAAoC,EAC1C,MAAM,WAAW,CAAC;AAUnB,qBAAa,mBAAoB,YAAW,oBAAoB;;gBAU5D,OAAO,EAAE,oCAAoC,EAC7C,WAAW,CAAC,EAAE,WAAW;IAuB3B,KAAK,CAAC,QAAQ,EAAE,QAAQ;YAiVV,gBAAgB;CAkC/B"}
@@ -82,9 +82,9 @@ class AngularRspackPlugin {
82
82
  callback();
83
83
  });
84
84
  compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
85
- // Handle errors thrown by loaders that prevent sealing
85
+ // Handle errors thrown by loaders that prevent sealing (but ignore for watch mode)
86
86
  compilation.hooks.afterSeal.tapAsync(PLUGIN_NAME, (callback) => {
87
- if (compilation.errors.length > 0) {
87
+ if (!watchRunInitialized && compilation.errors.length > 0) {
88
88
  const stats = compilation.getStats();
89
89
  const compilationError = (0, stats_1.statsErrorsToString)(stats.toJson(), (0, get_stats_options_1.getStatsOptions)(tslib_1.__classPrivateFieldGet(this, _AngularRspackPlugin__options, "f").verbose));
90
90
  callback(new Error(compilationError));
@@ -228,7 +228,8 @@ class AngularRspackPlugin {
228
228
  ? { ...defaultStatsOptions, ...configStats }
229
229
  : defaultStatsOptions;
230
230
  (0, stats_1.rspackStatsLogger)(stats, statsOptions);
231
- if (stats.hasErrors()) {
231
+ // Don't forcibly exit the process with errors when in watch mode
232
+ if (!watchRunInitialized && stats.hasErrors()) {
232
233
  process.exit(1);
233
234
  }
234
235
  });
@@ -27,7 +27,7 @@ function findProjectForPath(filePath, projectRootMap) {
27
27
  * Windows may pass Win-style file paths
28
28
  * Ensure filePath is in UNIX-style
29
29
  */
30
- let currentPath = node_path_1.posix.normalize(filePath);
30
+ let currentPath = node_path_1.posix.normalize(filePath.replaceAll('\\', '/'));
31
31
  for (; currentPath != node_path_1.posix.dirname(currentPath); currentPath = node_path_1.posix.dirname(currentPath)) {
32
32
  const p = projectRootMap.get(currentPath);
33
33
  if (p) {
@@ -1 +1 @@
1
- {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/stats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,sBAAsB,EAGvB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oCAAoC,EACpC,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,yCAAyC,CAAC;AAMjD,MAAM,WAAW,qBAAqB;IACpC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,aAAa,CAAC,OAAO,CAAC,EACtB,MAAM,GAAG,OAAO,GAAG,SAAS,CAC7B,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,kBAAkB,EAAE,EACtC,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,gBAAgB,EAC7B,OAAO,EAAE,oCAAoC,GAC5C,eAAe,CA2DjB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,YAAY,EACzB,cAAc,CAAC,EAAE,sBAAsB,EAAE,GACxC,IAAI,CAgBN"}
@@ -68,6 +68,7 @@ function generateBundleStats(info) {
68
68
  // where each builder has different output path.
69
69
  // Ideally, we should create the logging callback as a factory, but that would need a refactoring.
70
70
  const runsCache = new Set();
71
+ const chunkHashCache = new Map();
71
72
  function statsToString(stats, json, statsConfig, budgetFailures) {
72
73
  if (!json.chunks?.length) {
73
74
  return '';
@@ -82,10 +83,17 @@ function statsToString(stats, json, statsConfig, budgetFailures) {
82
83
  let unchangedChunkNumber = 0;
83
84
  let hasEstimatedTransferSizes = false;
84
85
  const isFirstRun = !runsCache.has(json.outputPath || '');
86
+ const prevHashes = chunkHashCache.get(json.outputPath || '') ??
87
+ new Map();
88
+ const nextHashes = new Map();
85
89
  for (const chunk of json.chunks) {
86
- // During first build we want to display unchanged chunks
87
- // but unchanged cached chunks are always marked as not rendered.
88
- if (!isFirstRun && !chunk.rendered) {
90
+ const key = chunk.id ?? chunk.names?.[0] ?? '';
91
+ const hash = chunk.hash ?? '';
92
+ nextHashes.set(key, hash);
93
+ // During first build we want to display all chunks.
94
+ // On rebuilds, skip chunks whose hash hasn't changed.
95
+ if (!isFirstRun && prevHashes.get(key) === hash) {
96
+ unchangedChunkNumber++;
89
97
  continue;
90
98
  }
91
99
  const assets = json.assets?.filter((asset) => {
@@ -141,8 +149,8 @@ function statsToString(stats, json, statsConfig, budgetFailures) {
141
149
  }
142
150
  changedChunksStats.push(generateBundleStats({ ...chunk, rawSize, estimatedTransferSize }));
143
151
  }
144
- unchangedChunkNumber = json.chunks.length - changedChunksStats.length;
145
152
  runsCache.add(json.outputPath || '');
153
+ chunkHashCache.set(json.outputPath || '', nextHashes);
146
154
  const statsTable = (0, private_1.generateBuildStatsTable)(changedChunksStats, colors, unchangedChunkNumber === 0, hasEstimatedTransferSizes, budgetFailures);
147
155
  // In some cases we do things outside of rspack context
148
156
  // Such us index generation, service worker augmentation etc...
@@ -295,10 +303,16 @@ function generateBuildEventStats(rspackStats, options) {
295
303
  let changedChunksCount = 0;
296
304
  const allChunksCount = chunks.length;
297
305
  const isFirstRun = !runsCache.has(rspackStats.outputPath || '');
306
+ const prevHashes = chunkHashCache.get(rspackStats.outputPath || '') ??
307
+ new Map();
298
308
  const chunkFiles = new Set();
299
309
  for (const chunk of chunks) {
300
- if (!isFirstRun && chunk.rendered) {
301
- changedChunksCount++;
310
+ if (!isFirstRun) {
311
+ const key = chunk.id ?? chunk.names?.[0] ?? '';
312
+ const hash = chunk.hash ?? '';
313
+ if (prevHashes.get(key) !== hash) {
314
+ changedChunksCount++;
315
+ }
302
316
  }
303
317
  if (chunk.initial) {
304
318
  initialChunksCount++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular-rspack",
3
- "version": "22.7.0-pr.34971.73bed1f",
3
+ "version": "22.7.0-pr.35356.e1b62ce",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -48,8 +48,8 @@
48
48
  "@ampproject/remapping": "2.3.0",
49
49
  "@babel/core": "7.28.3",
50
50
  "@discoveryjs/json-ext": "0.6.3",
51
- "@nx/angular-rspack-compiler": "22.7.0-pr.34971.73bed1f",
52
- "@nx/devkit": "22.7.0-pr.34971.73bed1f",
51
+ "@nx/angular-rspack-compiler": "22.7.0-pr.35356.e1b62ce",
52
+ "@nx/devkit": "22.7.0-pr.35356.e1b62ce",
53
53
  "ansi-colors": "4.1.3",
54
54
  "autoprefixer": "10.4.21",
55
55
  "deepmerge": "^4.3.1",
@@ -115,9 +115,7 @@
115
115
  "build": {
116
116
  "command": "node ./scripts/copy-readme.js angular-rspack packages/angular-rspack/readme-template.md packages/angular-rspack/README.md",
117
117
  "inputs": [
118
- "{projectRoot}/readme-template.md",
119
- "{workspaceRoot}/scripts/copy-readme.js",
120
- "{workspaceRoot}/scripts/readme-fragments"
118
+ "copyReadme"
121
119
  ],
122
120
  "outputs": [
123
121
  "{projectRoot}/README.md"
@@ -129,11 +127,6 @@
129
127
  "^build-native",
130
128
  "angular-rspack-compiler:build"
131
129
  ],
132
- "inputs": [
133
- "default",
134
- "^production",
135
- "{projectRoot}/vitest.config.mts"
136
- ],
137
130
  "options": {
138
131
  "args": [
139
132
  "--passWithNoTests"